Class: Fog::Attributes::Boolean

Inherits:
Default
  • Object
show all
Defined in:
lib/fog/core/attributes/boolean.rb

Overview

Fog Boolean Attribute

This class handles Boolean attributes from the providers, converting values to Boolean objects

Instance Attribute Summary

Attributes inherited from Default

#aliases, #as, #default, #model, #name, #squash

Instance Method Summary collapse

Methods inherited from Default

#create_aliases, #create_getter, #create_mask, #initialize, #set_defaults

Constructor Details

This class inherits a constructor from Fog::Attributes::Default

Instance Method Details

#create_setterObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fog/core/attributes/boolean.rb', line 8

def create_setter
  model.class_eval "      def \#{name}=(new_\#{name})\n        attributes[:\#{name}] = case new_\#{name}\n        when true,'true'\n          true\n        when false,'false'\n          false\n        end\n      end\n  EOS\nend\n", __FILE__, __LINE__