Class: Verizon::Actionobject
- Defined in:
- lib/verizon/models/actionobject.rb
Overview
Actionobject Model.
Instance Attribute Summary collapse
-
#change_plan ⇒ TrueClass | FalseClass
a flag to set if the trigger changes service plans, true, or not, false.
-
#change_plan_details ⇒ ChangePlanDetails
The service plan code to switch to.
-
#suspend ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#suspend_details ⇒ Suspenddetailsobject
TODO: Write general description for this method.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(suspend = SKIP, suspend_details = SKIP, change_plan = SKIP, change_plan_details = SKIP) ⇒ Actionobject
constructor
A new instance of Actionobject.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(suspend = SKIP, suspend_details = SKIP, change_plan = SKIP, change_plan_details = SKIP) ⇒ Actionobject
Returns a new instance of Actionobject.
53 54 55 56 57 58 59 |
# File 'lib/verizon/models/actionobject.rb', line 53 def initialize(suspend = SKIP, suspend_details = SKIP, change_plan = SKIP, change_plan_details = SKIP) @suspend = suspend unless suspend == SKIP @suspend_details = suspend_details unless suspend_details == SKIP @change_plan = change_plan unless change_plan == SKIP @change_plan_details = change_plan_details unless change_plan_details == SKIP end |
Instance Attribute Details
#change_plan ⇒ TrueClass | FalseClass
a flag to set if the trigger changes service plans, true, or not, false
22 23 24 |
# File 'lib/verizon/models/actionobject.rb', line 22 def change_plan @change_plan end |
#change_plan_details ⇒ ChangePlanDetails
The service plan code to switch to
26 27 28 |
# File 'lib/verizon/models/actionobject.rb', line 26 def change_plan_details @change_plan_details end |
#suspend ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/actionobject.rb', line 14 def suspend @suspend end |
#suspend_details ⇒ Suspenddetailsobject
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/actionobject.rb', line 18 def suspend_details @suspend_details end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/verizon/models/actionobject.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. suspend = hash.key?('suspend') ? hash['suspend'] : SKIP suspend_details = Suspenddetailsobject.from_hash(hash['suspendDetails']) if hash['suspendDetails'] change_plan = hash.key?('changePlan') ? hash['changePlan'] : SKIP change_plan_details = ChangePlanDetails.from_hash(hash['changePlanDetails']) if hash['changePlanDetails'] # Create object from extracted values. Actionobject.new(suspend, suspend_details, change_plan, change_plan_details) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/verizon/models/actionobject.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['suspend'] = 'suspend' @_hash['suspend_details'] = 'suspendDetails' @_hash['change_plan'] = 'changePlan' @_hash['change_plan_details'] = 'changePlanDetails' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/actionobject.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/verizon/models/actionobject.rb', line 39 def self.optionals %w[ suspend suspend_details change_plan change_plan_details ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
82 83 84 85 86 87 88 |
# File 'lib/verizon/models/actionobject.rb', line 82 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
98 99 100 101 102 103 |
# File 'lib/verizon/models/actionobject.rb', line 98 def inspect class_name = self.class.name.split('::').last "<#{class_name} suspend: #{@suspend.inspect}, suspend_details: #{@suspend_details.inspect},"\ " change_plan: #{@change_plan.inspect}, change_plan_details:"\ " #{@change_plan_details.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 |
# File 'lib/verizon/models/actionobject.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} suspend: #{@suspend}, suspend_details: #{@suspend_details}, change_plan:"\ " #{@change_plan}, change_plan_details: #{@change_plan_details}>" end |