Class: Hypa::Attribute
- Inherits:
-
Object
- Object
- Hypa::Attribute
- Defined in:
- lib/hypa.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(properties = {}) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_hash ⇒ Object
Constructor Details
#initialize(properties = {}) ⇒ Attribute
Returns a new instance of Attribute.
9 10 11 12 |
# File 'lib/hypa.rb', line 9 def initialize(properties = {}) @name = properties.delete(:name) @type = properties.delete(:type) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/hypa.rb', line 7 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/hypa.rb', line 7 def type @type end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 |
# File 'lib/hypa.rb', line 14 def to_hash { name: @name.to_s, type: @type.to_s } end |