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.
70 71 72 |
# File 'lib/factory_burgers/models/factory.rb', line 70 def initialize(column) @column = column end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
68 69 70 |
# File 'lib/factory_burgers/models/factory.rb', line 68 def column @column end |
Instance Method Details
#name ⇒ Object
82 83 84 |
# File 'lib/factory_burgers/models/factory.rb', line 82 def name column.name end |
#to_h ⇒ Object
74 75 76 |
# File 'lib/factory_burgers/models/factory.rb', line 74 def to_h {name: name} end |
#to_json ⇒ Object
78 79 80 |
# File 'lib/factory_burgers/models/factory.rb', line 78 def to_json(...) to_h.to_json(...) end |