Class: ShellDataReportingApIs::CurrentVolume

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

Overview

CurrentVolume Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(fee_rule_id = SKIP, fee_rule_description = SKIP, month = SKIP, year = SKIP, total_volume = SKIP) ⇒ CurrentVolume

Returns a new instance of CurrentVolume.



67
68
69
70
71
72
73
74
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 67

def initialize(fee_rule_id = SKIP, fee_rule_description = SKIP,
               month = SKIP, year = SKIP, total_volume = SKIP)
  @fee_rule_id = fee_rule_id unless fee_rule_id == SKIP
  @fee_rule_description = fee_rule_description unless fee_rule_description == SKIP
  @month = month unless month == SKIP
  @year = year unless year == SKIP
  @total_volume = total_volume unless total_volume == SKIP
end

Instance Attribute Details

#fee_rule_descriptionString

Bonus or association bonus configuration description that is associated to the payer.

Returns:

  • (String)


20
21
22
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 20

def fee_rule_description
  @fee_rule_description
end

#fee_rule_idInteger

Bonus or association bonus configuration identifier that is associated to the payer

Returns:

  • (Integer)


15
16
17
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 15

def fee_rule_id
  @fee_rule_id
end

#monthInteger

Consumption(Volume) of the month.

Returns:

  • (Integer)


24
25
26
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 24

def month
  @month
end

#total_volumeFloat

Total volume consumption for the month/year above.

Returns:

  • (Float)


32
33
34
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 32

def total_volume
  @total_volume
end

#yearString

Consumption (Volume) of the year.

Returns:

  • (String)


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

def year
  @year
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  fee_rule_id = hash.key?('FeeRuleId') ? hash['FeeRuleId'] : SKIP
  fee_rule_description =
    hash.key?('FeeRuleDescription') ? hash['FeeRuleDescription'] : SKIP
  month = hash.key?('Month') ? hash['Month'] : SKIP
  year = hash.key?('Year') ? hash['Year'] : SKIP
  total_volume = hash.key?('TotalVolume') ? hash['TotalVolume'] : SKIP

  # Create object from extracted values.
  CurrentVolume.new(fee_rule_id,
                    fee_rule_description,
                    month,
                    year,
                    total_volume)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
43
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['fee_rule_id'] = 'FeeRuleId'
  @_hash['fee_rule_description'] = 'FeeRuleDescription'
  @_hash['month'] = 'Month'
  @_hash['year'] = 'Year'
  @_hash['total_volume'] = 'TotalVolume'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
60
61
62
63
64
65
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 57

def self.nullables
  %w[
    fee_rule_id
    fee_rule_description
    month
    year
    total_volume
  ]
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
53
54
# File 'lib/shell_data_reporting_ap_is/models/current_volume.rb', line 46

def self.optionals
  %w[
    fee_rule_id
    fee_rule_description
    month
    year
    total_volume
  ]
end