Module: Steppable::InstanceMethods

Defined in:
lib/cooklang_rb/steppable.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



20
21
22
# File 'lib/cooklang_rb/steppable.rb', line 20

def attributes
  self.class.attributes
end

#to_stepObject



8
9
10
11
12
13
14
# File 'lib/cooklang_rb/steppable.rb', line 8

def to_step
  data = { "type" => type }
  attributes.each do |key|
    data[key.to_s] = send key
  end
  data
end

#typeObject



16
17
18
# File 'lib/cooklang_rb/steppable.rb', line 16

def type
  self.class.name.to_s.split("::").last.downcase
end