Class: VCWineList

Inherits:
VinoChipperModel show all
Defined in:
lib/models/vcwinelist.rb

Instance Method Summary collapse

Methods inherited from VinoChipperModel

#keys, #method_missing, #respond_to_missing?

Constructor Details

#initialize(deets) ⇒ VCWineList

Returns a new instance of VCWineList.



7
8
9
10
11
12
# File 'lib/models/vcwinelist.rb', line 7

def initialize(deets)
  super
  self.winery    = VCWinery.new(winery)
  self.wines     = wines.map { |wine| VCWine.new(wine) }
  self.ships_to  = ships_to.map { |state| VCState.new(state) }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VinoChipperModel

Instance Method Details

#to_sObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/models/vcwinelist.rb', line 14

def to_s
  "Winery: #{winery}

Wines: #{wines.map { |wine| wine & :to_s }}

Promotions: #{promotions}

Ships_to: #{ships_to.map { |state| state & :to_s }}

Special_Shipping: #{special_shipping}"
end