Class: Convection::Model::Template::Resource::HashProperty

Inherits:
Property
  • Object
show all
Defined in:
lib/convection/model/template/resource.rb

Overview

A Hash Property

Instance Attribute Summary

Attributes inherited from Property

#default, #equal_to, #immutable, #kind_of, #name, #property_name, #regex, #required, #transform

Instance Method Summary collapse

Methods inherited from Property

create, #initialize

Constructor Details

This class inherits a constructor from Convection::Model::Template::Resource::Property

Instance Method Details

#attach(resource) ⇒ Object



188
189
190
191
192
193
194
# File 'lib/convection/model/template/resource.rb', line 188

def attach(resource)
  definition = self ## Expose to resource instance closure

  resource.attach_method(definition.name) do |key, value = nil|
    properties[definition.property_name].set(key, value)
  end
end

#instance(resource) ⇒ Object



196
197
198
# File 'lib/convection/model/template/resource.rb', line 196

def instance(resource)
  HashPropertyInstance.new(resource, self)
end