Class: FactoryBurgers::Models::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_burgers/models/factory.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#columnObject (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

#nameObject



91
92
93
# File 'lib/factory_burgers/models/factory.rb', line 91

def name
  column.name
end

#to_hObject



83
84
85
# File 'lib/factory_burgers/models/factory.rb', line 83

def to_h
  {name: name}
end

#to_jsonObject



87
88
89
# File 'lib/factory_burgers/models/factory.rb', line 87

def to_json(...)
  to_h.to_json(...)
end