Class: Io::Flow::V0::Models::GenericReservationError

Inherits:
ReservationError show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from ReservationError

#code

Instance Method Summary collapse

Methods inherited from ReservationError

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ GenericReservationError

Returns a new instance of GenericReservationError.



34698
34699
34700
34701
34702
34703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34698

def initialize(incoming={})
  super(:code => ReservationError::Types::GENERIC_RESERVATION_ERROR)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:messages], 'GenericReservationError')
  @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



34696
34697
34698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34696

def messages
  @messages
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



34709
34710
34711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34709

def copy(incoming={})
  GenericReservationError.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



34713
34714
34715
34716
34717
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34713

def subtype_to_hash
  {
    :messages => messages
  }
end

#to_jsonObject



34705
34706
34707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34705

def to_json
  JSON.dump(to_hash)
end