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.



70
71
72
# File 'lib/factory_burgers/models/factory.rb', line 70

def initialize(column)
  @column = column
end

Instance Attribute Details

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

#nameObject



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

def name
  column.name
end

#to_hObject



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

def to_h
  {name: name}
end

#to_jsonObject



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

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