Class: ShellDataReportingApIs::PricingHistory

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/pricing_history.rb

Overview

PricingHistory Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(from_date = SKIP, to_date = SKIP, fees_rule_id = SKIP, fees_rule_description = SKIP, total_volume = SKIP) ⇒ PricingHistory

Returns a new instance of PricingHistory.



73
74
75
76
77
78
79
80
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 73

def initialize(from_date = SKIP, to_date = SKIP, fees_rule_id = SKIP,
               fees_rule_description = SKIP, total_volume = SKIP)
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
  @fees_rule_id = fees_rule_id unless fees_rule_id == SKIP
  @fees_rule_description = fees_rule_description unless fees_rule_description == SKIP
  @total_volume = total_volume unless total_volume == SKIP
end

Instance Attribute Details

#fees_rule_descriptionString

Pricing History Period Fees Rule Description that is associated to the period of that associated payer.

Returns:

  • (String)


33
34
35
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 33

def fees_rule_description
  @fees_rule_description
end

#fees_rule_idInteger

Pricing History Period Fees Rule ID that is associated to the period of that associated payer.

Example: 8101

Returns:

  • (Integer)


28
29
30
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 28

def fees_rule_id
  @fees_rule_id
end

#from_dateString

Pricing History Period Start date and should be the first date of the month. Format: YYYYMMDD

Returns:

  • (String)


16
17
18
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 16

def from_date
  @from_date
end

#to_dateString

Pricing History Period end date and should be the last date of the period month. Format: YYYYMMDD

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 22

def to_date
  @to_date
end

#total_volumeFloat

Total Quantity for the Pricing History Period that is associated to that payer.

Returns:

  • (Float)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 38

def total_volume
  @total_volume
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP
  fees_rule_id = hash.key?('FeesRuleID') ? hash['FeesRuleID'] : SKIP
  fees_rule_description =
    hash.key?('FeesRuleDescription') ? hash['FeesRuleDescription'] : SKIP
  total_volume = hash.key?('TotalVolume') ? hash['TotalVolume'] : SKIP

  # Create object from extracted values.
  PricingHistory.new(from_date,
                     to_date,
                     fees_rule_id,
                     fees_rule_description,
                     total_volume)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['fees_rule_id'] = 'FeesRuleID'
  @_hash['fees_rule_description'] = 'FeesRuleDescription'
  @_hash['total_volume'] = 'TotalVolume'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
66
67
68
69
70
71
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 63

def self.nullables
  %w[
    from_date
    to_date
    fees_rule_id
    fees_rule_description
    total_volume
  ]
end

.optionalsObject

An array for optional fields



52
53
54
55
56
57
58
59
60
# File 'lib/shell_data_reporting_ap_is/models/pricing_history.rb', line 52

def self.optionals
  %w[
    from_date
    to_date
    fees_rule_id
    fees_rule_description
    total_volume
  ]
end