Class: Verizon::CarrierServicePlan
- Defined in:
- lib/verizon/models/carrier_service_plan.rb
Overview
CarrierServicePlan Model.
Instance Attribute Summary collapse
-
#carrier_service_plan_code ⇒ String
The billing record ID.
-
#code ⇒ String
The inventory name or system name of the service plan.
-
#name ⇒ String
The name of the service plan.
-
#size_kb ⇒ String
The ammount of space the service plan will occupy on the Subscriber Information Module (SIM).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name = SKIP, code = SKIP, size_kb = SKIP, carrier_service_plan_code = SKIP) ⇒ CarrierServicePlan
constructor
A new instance of CarrierServicePlan.
Methods inherited from BaseModel
Constructor Details
#initialize(name = SKIP, code = SKIP, size_kb = SKIP, carrier_service_plan_code = SKIP) ⇒ CarrierServicePlan
Returns a new instance of CarrierServicePlan.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 54 def initialize(name = SKIP, code = SKIP, size_kb = SKIP, carrier_service_plan_code = SKIP) @name = name unless name == SKIP @code = code unless code == SKIP @size_kb = size_kb unless size_kb == SKIP unless carrier_service_plan_code == SKIP @carrier_service_plan_code = carrier_service_plan_code end end |
Instance Attribute Details
#carrier_service_plan_code ⇒ String
The billing record ID. This can be numeric, alpha or alphanumeric.
27 28 29 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 27 def carrier_service_plan_code @carrier_service_plan_code end |
#code ⇒ String
The inventory name or system name of the service plan
18 19 20 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 18 def code @code end |
#name ⇒ String
The name of the service plan
14 15 16 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 14 def name @name end |
#size_kb ⇒ String
The ammount of space the service plan will occupy on the Subscriber Information Module (SIM)
23 24 25 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 23 def size_kb @size_kb end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP code = hash.key?('code') ? hash['code'] : SKIP size_kb = hash.key?('sizeKb') ? hash['sizeKb'] : SKIP carrier_service_plan_code = hash.key?('carrierServicePlanCode') ? hash['carrierServicePlanCode'] : SKIP # Create object from extracted values. CarrierServicePlan.new(name, code, size_kb, carrier_service_plan_code) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['code'] = 'code' @_hash['size_kb'] = 'sizeKb' @_hash['carrier_service_plan_code'] = 'carrierServicePlanCode' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/verizon/models/carrier_service_plan.rb', line 40 def self.optionals %w[ name code size_kb carrier_service_plan_code ] end |