Class: CloudParty::Responses::Error
- Inherits:
-
Object
- Object
- CloudParty::Responses::Error
- Defined in:
- lib/cloud_party/responses/ips.rb,
lib/cloud_party/responses/zones.rb,
lib/cloud_party/responses/accounts.rb,
lib/cloud_party/responses/dns_records.rb,
lib/cloud_party/responses/memberships.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(error) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(error) ⇒ Error
Returns a new instance of Error.
94 95 96 97 98 |
# File 'lib/cloud_party/responses/ips.rb', line 94 def initialize(error) @error = error @code = error.fetch(:code, nil) @message = error.fetch(:message, nil) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
100 101 102 |
# File 'lib/cloud_party/responses/ips.rb', line 100 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
102 103 104 |
# File 'lib/cloud_party/responses/ips.rb', line 102 def @message end |
Instance Method Details
#inspect ⇒ Object
104 105 106 |
# File 'lib/cloud_party/responses/ips.rb', line 104 def inspect to_s end |
#to_s ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/cloud_party/responses/ips.rb', line 108 def to_s wanted_methods = %i[code message] our_methods = methods.select do |m| wanted_methods.include? m end outputs = [] our_methods.each do |m| outputs << "#{m}=#{send(m)}" end "#<Error: #{output.join(', ')}>" end |