class Convection::Model::Template::Resource::ScalarProperty

A Scalar Property

Public Instance Methods

attach(resource) click to toggle source
# File lib/convection/model/template/resource.rb, line 151
def attach(resource)
  definition = self ## Expose to resource instance closure

  resource.attach_method(definition.name) do |value = nil|
    return properties[definition.property_name].value if value.nil?
    properties[definition.property_name].set(value)
  end

  resource.attach_method("#{ definition.name }=") do |value|
    properties[definition.property_name].set(value)
  end
end
instance(resource) click to toggle source
# File lib/convection/model/template/resource.rb, line 164
def instance(resource)
  ScalarPropertyInstance.new(resource, self)
end