Class: BlackStack::CustomPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/customplan.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/customplan.rb', line 8

def to_hash
  h = {}
  h[:type] = self.type # not null
  h[:item_number] = self.item_number # not null 
  h[:name] = self.name # not null
  h[:credits] = self.credits # not null
  h[:fee] = self.fee # not null
  h[:period] = self.period # not null
  h[:units] = self.units # not null
   
  h[:trial_credits] = self.trial_credits      if self.trial_credits != nil
  h[:trial_fee] = self.trial_fee              if self.trial_fee != nil
  h[:trial_period] = self.trial_period        if self.trial_period != nil
  h[:trial_units] = self.trial_units          if self.trial_units != nil
  
  h[:trial2_credits] = self.trial2_credits    if self.trial2_credits != nil
  h[:trial2_fee] = self.trial2_fee            if self.trial2_fee != nil
  h[:trial2_period] = self.trial2_period      if self.trial2_period != nil
  h[:trial2_units] = self.trial2_units        if self.trial2_units != nil
  
  h[:description] = self.description # not null
  h
end