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.



75
76
77
# File 'lib/factory_burgers/models/factory.rb', line 75

def initialize(column)
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



73
74
75
# File 'lib/factory_burgers/models/factory.rb', line 73

def column
  @column
end

Instance Method Details

#nameObject



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

def name
  column.name
end

#to_hObject



79
80
81
# File 'lib/factory_burgers/models/factory.rb', line 79

def to_h
  {name: name}
end

#to_jsonObject



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

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