Class: SimpleObjects::Attribute
- Inherits:
-
Object
- Object
- SimpleObjects::Attribute
- Defined in:
- lib/simple_objects/attribute.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, opts = {}) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, opts = {}) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 8 9 |
# File 'lib/simple_objects/attribute.rb', line 5 def initialize(name, opts = {}) @name = name @required = false apply_opts(opts) end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
3 4 5 |
# File 'lib/simple_objects/attribute.rb', line 3 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/simple_objects/attribute.rb', line 3 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
3 4 5 |
# File 'lib/simple_objects/attribute.rb', line 3 def required @required end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/simple_objects/attribute.rb', line 3 def type @type end |