Class: ShellDataReportingApIs::PricedTransactionReqV2PeriodEnum
- Inherits:
-
Object
- Object
- ShellDataReportingApIs::PricedTransactionReqV2PeriodEnum
- Defined in:
- lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb
Overview
Pass below one of the value as per the required transaction period 1. Last 7 Days 2. Last 30 Days 3. Last 90 Days
Constant Summary collapse
- PRICED_TRANSACTION_REQ_V2_PERIOD_ENUM =
[ # TODO: Write general description for ENUM_1 ENUM_1 = 1, # TODO: Write general description for ENUM_2 ENUM_2 = 2, # TODO: Write general description for ENUM_3 ENUM_3 = 3 ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_1) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb', line 27 def self.from_value(value, default_value = ENUM_1) return default_value if value.nil? str = value.to_s.strip if str.match?(/\A\d+\z/) num = str.to_i return num if PRICED_TRANSACTION_REQ_V2_PERIOD_ENUM.include?(num) return default_value end case str.downcase when 'enum_1' then ENUM_1 when 'enum_2' then ENUM_2 when 'enum_3' then ENUM_3 else default_value end end |
.validate(value) ⇒ Object
21 22 23 24 25 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb', line 21 def self.validate(value) return false if value.nil? PRICED_TRANSACTION_REQ_V2_PERIOD_ENUM.include?(value) end |