Class: Trestle::Attribute
- Inherits:
-
Object
- Object
- Trestle::Attribute
- Defined in:
- lib/trestle/attribute.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Association
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #array? ⇒ Boolean
-
#initialize(name, type, options = {}) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, type, options = {}) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 |
# File 'lib/trestle/attribute.rb', line 5 def initialize(name, type, ={}) @name, @type, @options = name.to_sym, type, end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/trestle/attribute.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/trestle/attribute.rb', line 3 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/trestle/attribute.rb', line 3 def type @type end |
Instance Method Details
#array? ⇒ Boolean
9 10 11 |
# File 'lib/trestle/attribute.rb', line 9 def array? [:array] == true end |