Class: CloudFormer::PropertyOrAttribute
- Inherits:
-
Object
- Object
- CloudFormer::PropertyOrAttribute
- Defined in:
- lib/cloud_former/property_or_attribute.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #as_json_for(instance) ⇒ Object
- #get_name ⇒ Object
-
#initialize(name, options) ⇒ PropertyOrAttribute
constructor
A new instance of PropertyOrAttribute.
Constructor Details
#initialize(name, options) ⇒ PropertyOrAttribute
Returns a new instance of PropertyOrAttribute.
6 7 8 9 |
# File 'lib/cloud_former/property_or_attribute.rb', line 6 def initialize(name, ) @name = name @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/cloud_former/property_or_attribute.rb', line 4 def @options end |
Instance Method Details
#as_json_for(instance) ⇒ Object
15 16 17 |
# File 'lib/cloud_former/property_or_attribute.rb', line 15 def as_json_for(instance) val_as_json(instance.send(get_name)) end |
#get_name ⇒ Object
11 12 13 |
# File 'lib/cloud_former/property_or_attribute.rb', line 11 def get_name @name end |