Class: Brewser::FermentationSchedule

Inherits:
Model
  • Object
show all
Defined in:
lib/brewser/model/fermentation_schedule.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



7
8
9
10
11
12
13
14
# File 'lib/brewser/model/fermentation_schedule.rb', line 7

def self.json_create(o)
  a = self.new
  o['fermentation_steps'].each do |step|
    a.fermentation_steps.push step
  end unless o['fermentation_steps'].nil?

  return a
end

Instance Method Details

#as_json(options = {}) ⇒ Object



16
17
18
19
20
21
# File 'lib/brewser/model/fermentation_schedule.rb', line 16

def as_json(options={})
  {
    JSON.create_id => "Brewser::FermentationSchedule",
    'fermentation_steps' => fermentation_steps.to_a
  }
end