Class: Veneer::Base::Property
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Veneer::Base::Property
- Defined in:
- lib/veneer/base/property.rb
Direct Known Subclasses
ActiveRecord::Base::VeneerInterface::Property, DataMapper::Resource::VeneerInterface::Property, MongoMapper::Document::VeneerInterface::Property
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(parent, properties) ⇒ Property
constructor
A new instance of Property.
- #normalize(properties) ⇒ Object
- #validators ⇒ Object
Constructor Details
#initialize(parent, properties) ⇒ Property
Returns a new instance of Property.
13 14 15 16 |
# File 'lib/veneer/base/property.rb', line 13 def initialize(parent, properties) @parent = parent super properties.merge(:type => normalize(properties[:type])) end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
4 5 6 |
# File 'lib/veneer/base/property.rb', line 4 def parent @parent end |
Instance Method Details
#normalize(properties) ⇒ Object
18 19 20 |
# File 'lib/veneer/base/property.rb', line 18 def normalize(properties) ::Kernel.raise ::Veneer::Errors::NotImplemented end |
#validators ⇒ Object
22 23 24 |
# File 'lib/veneer/base/property.rb', line 22 def validators parent.validators_on(name) end |