Class: CloudFormer::PropertyOrAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_former/property_or_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options)
  @name = name
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/cloud_former/property_or_attribute.rb', line 4

def options
  @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_nameObject



11
12
13
# File 'lib/cloud_former/property_or_attribute.rb', line 11

def get_name
  @name
end