Class: PreferredRegionAreaConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
app/models/preferred_region_area_constraint.rb

Instance Method Summary collapse

Methods inherited from Base

ma_accessor, ma_reader, ma_writer, #serialize_more_attributes

Instance Method Details

#as_json(options = {}) ⇒ Object


10
11
12
13
14
15
# File 'app/models/preferred_region_area_constraint.rb', line 10

def as_json(options={})
  hash = super
  hash[:ingredient_id] = self.ingredient.id
  hash[:preferred_region_area] = self.preferred_region_area
  hash
end

#region_areasObject


6
7
8
# File 'app/models/preferred_region_area_constraint.rb', line 6

def region_areas
  Resource.regions(self.preferred_region_area)
end

#region_codesObject


2
3
4
# File 'app/models/preferred_region_area_constraint.rb', line 2

def region_codes
  Resource.region_codes(self.preferred_region_area)
end