Class: Brewser::FermentationStep

Inherits:
Model
  • Object
show all
Defined in:
lib/brewser/model/fermentation_steps.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#as_beerxml, #as_brewson, auto_migrate_down!, auto_migrate_up!, auto_upgrade!, default_repository_name

Class Method Details

.json_create(o) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/brewser/model/fermentation_steps.rb', line 12

def self.json_create(o)
  a = self.new
  a.name = o['name']
  a.purpose = o['purpose']
  a.index = o['index']
  a.time = o['time'].u unless o['time'].blank?
  a.temperature = o['temperature'].u unless o['temperature'].blank?

  return a
end

Instance Method Details

#as_json(options = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/brewser/model/fermentation_steps.rb', line 23

def as_json(options={})
  {
    JSON.create_id=> "Brewser::FermentationStep",
    'name' => name, 'purpose' => purpose,
    'index' => index, 
    'time' => time.to_s, 'temperature' => temperature.to_s
  }
end