[chef] Re: LWRP Boolean


Chronological Thread 
  • From: Graham Christensen < >
  • To:
  • Subject: [chef] Re: LWRP Boolean
  • Date: Fri, 12 Apr 2013 08:59:45 -0400

Hi Cassiano,

A common trick to implement this, which I've seen across a number of LWRPs is to do:

:kind_of => [TrueClass, FalseClass]


-- 
Graham Christensen

On Friday, April 12, 2013 at 8:56 AM, Cassiano Leal wrote:

Ohai Chefs!

What's the "correct" way to have a boolean attribute in a LWRP? There's no Boolean class in Ruby, so 

attribute :some_boolean, :kind_of => Boolean, :default => false

is not possible.

What's the solution?

Thanks,

- cassiano





Archive powered by MHonArc 2.6.16.

§