Class: ODDB::State::User::FiPiOfferInput::FiPiOffer

Inherits:
Object
  • Object
show all
Defined in:
src/state/user/fipi_offer_input.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) fi_quantity

Returns the value of attribute fi_quantity



17
18
19
# File 'src/state/user/fipi_offer_input.rb', line 17

def fi_quantity
  @fi_quantity.to_i
end

- (Object) fi_update

Returns the value of attribute fi_update



16
17
18
# File 'src/state/user/fipi_offer_input.rb', line 16

def fi_update
  @fi_update
end

- (Object) pi_quantity

Returns the value of attribute pi_quantity



17
18
19
# File 'src/state/user/fipi_offer_input.rb', line 17

def pi_quantity
  @pi_quantity.to_i
end

- (Object) pi_update

Returns the value of attribute pi_update



16
17
18
# File 'src/state/user/fipi_offer_input.rb', line 16

def pi_update
  @pi_update
end

Instance Method Details

- (Object) activation_count



28
29
30
# File 'src/state/user/fipi_offer_input.rb', line 28

def activation_count
  fi_activation_count + pi_activation_count
end

- (Object) calculate_fi_charge



59
60
61
62
63
# File 'src/state/user/fipi_offer_input.rb', line 59

def calculate_fi_charge
  if(@fi_quantity)
    @fi_quantity.to_i * FI_UPLOAD_PRICES[:annual_fee]
  end.to_i
end

- (Object) calculate_fi_update



64
65
66
67
68
# File 'src/state/user/fipi_offer_input.rb', line 64

def calculate_fi_update
  if(@fi_update=='update_ywesee')
    @fi_quantity.to_i * FI_UPLOAD_PRICES[:processing]
  end.to_i
end

- (Object) calculate_pi_charge



69
70
71
72
73
# File 'src/state/user/fipi_offer_input.rb', line 69

def calculate_pi_charge
  if(@pi_quantity)
    @pi_quantity.to_i * PI_UPLOAD_PRICES[:annual_fee]
  end.to_i
end

- (Object) calculate_pi_update



74
75
76
77
78
# File 'src/state/user/fipi_offer_input.rb', line 74

def calculate_pi_update
  if(@pi_update=='update_ywesee')
    @pi_quantity.to_i * PI_UPLOAD_PRICES[:processing]
  end.to_i
end

- (Object) calculate_total



79
80
81
82
# File 'src/state/user/fipi_offer_input.rb', line 79

def calculate_total
  calculate_activation_charge = fi_calculate_activation_charge + pi_calculate_activation_charge
  calculate_total_charges + calculate_activation_charge
end

- (Object) calculate_total_charges



83
84
85
86
# File 'src/state/user/fipi_offer_input.rb', line 83

def calculate_total_charges
  calculate_fi_charge + calculate_fi_update + \
  calculate_pi_charge + calculate_pi_update
end

- (Object) fi_activation_count



23
24
25
26
27
# File 'src/state/user/fipi_offer_input.rb', line 23

def fi_activation_count
  count = 0
  count += 1 unless (@fi_quantity=="" || @fi_quantity=="0")
  count
end

- (Object) fi_calculate_activation_charge



56
57
58
# File 'src/state/user/fipi_offer_input.rb', line 56

def fi_calculate_activation_charge
  fi_activation_count * FI_UPLOAD_PRICES[:activation]
end

- (Object) fi_charge



31
32
33
# File 'src/state/user/fipi_offer_input.rb', line 31

def fi_charge
  FI_UPLOAD_PRICES[:annual_fee]
end

- (Object) fi_update_charge



34
35
36
37
38
# File 'src/state/user/fipi_offer_input.rb', line 34

def fi_update_charge
  if(@fi_update=='update_ywesee')
    FI_UPLOAD_PRICES[:processing]
  end.to_i
end

- (Object) pi_activation_count



18
19
20
21
22
# File 'src/state/user/fipi_offer_input.rb', line 18

def pi_activation_count
  count = 0
  count += 1 unless (@pi_quantity=="" || @pi_quantity=="0")
  count
end

- (Object) pi_calculate_activation_charge



53
54
55
# File 'src/state/user/fipi_offer_input.rb', line 53

def pi_calculate_activation_charge
  pi_activation_count * PI_UPLOAD_PRICES[:activation]
end

- (Object) pi_charge



42
43
44
# File 'src/state/user/fipi_offer_input.rb', line 42

def pi_charge
  PI_UPLOAD_PRICES[:annual_fee]
end

- (Object) pi_update_charge



45
46
47
48
49
# File 'src/state/user/fipi_offer_input.rb', line 45

def pi_update_charge
  if(@pi_update=='update_ywesee')
    PI_UPLOAD_PRICES[:processing]
  end.to_i
end