Class: FactoryBurgers::Models::Attribute
- Inherits:
-
Object
- Object
- FactoryBurgers::Models::Attribute
- Defined in:
- lib/factory_burgers/models/factory.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
Instance Method Summary collapse
-
#initialize(column) ⇒ Attribute
constructor
A new instance of Attribute.
- #name ⇒ Object
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(column) ⇒ Attribute
Returns a new instance of Attribute.
79 80 81 |
# File 'lib/factory_burgers/models/factory.rb', line 79 def initialize(column) @column = column end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
77 78 79 |
# File 'lib/factory_burgers/models/factory.rb', line 77 def column @column end |
Instance Method Details
#name ⇒ Object
91 92 93 |
# File 'lib/factory_burgers/models/factory.rb', line 91 def name column.name end |
#to_h ⇒ Object
83 84 85 |
# File 'lib/factory_burgers/models/factory.rb', line 83 def to_h {name: name} end |
#to_json ⇒ Object
87 88 89 |
# File 'lib/factory_burgers/models/factory.rb', line 87 def to_json(...) to_h.to_json(...) end |