Class: Sdp::RampQuote

Inherits:
Struct
  • Object
show all
Defined in:
lib/sdp/resources/ramps.rb

Overview

A ramp quote: indicative pricing plus a hosted checkout URL for an on-ramp. SDP omits optional fields, so each member is nil when absent. The *_currency members are passed through as { code, decimals, name, symbol } hashes; amounts are numbers as SDP sends them.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#delivery_modeObject

Returns the value of attribute delivery_mode

Returns:

  • (Object)

    the current value of delivery_mode



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def delivery_mode
  @delivery_mode
end

#exchange_rateObject

Returns the value of attribute exchange_rate

Returns:

  • (Object)

    the current value of exchange_rate



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def exchange_rate
  @exchange_rate
end

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def expires_at
  @expires_at
end

#fee_currencyObject

Returns the value of attribute fee_currency

Returns:

  • (Object)

    the current value of fee_currency



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def fee_currency
  @fee_currency
end

#fees_includedObject

Returns the value of attribute fees_included

Returns:

  • (Object)

    the current value of fees_included



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def fees_included
  @fees_included
end

#hosted_urlObject

Returns the value of attribute hosted_url

Returns:

  • (Object)

    the current value of hosted_url



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def hosted_url
  @hosted_url
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def id
  @id
end

#payment_instructionsObject

Returns the value of attribute payment_instructions

Returns:

  • (Object)

    the current value of payment_instructions



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def payment_instructions
  @payment_instructions
end

#providerObject

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def provider
  @provider
end

#receiving_currencyObject

Returns the value of attribute receiving_currency

Returns:

  • (Object)

    the current value of receiving_currency



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def receiving_currency
  @receiving_currency
end

#sending_currencyObject

Returns the value of attribute sending_currency

Returns:

  • (Object)

    the current value of sending_currency



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def sending_currency
  @sending_currency
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def status
  @status
end

#total_receiving_amountObject

Returns the value of attribute total_receiving_amount

Returns:

  • (Object)

    the current value of total_receiving_amount



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def total_receiving_amount
  @total_receiving_amount
end

#total_sending_amountObject

Returns the value of attribute total_sending_amount

Returns:

  • (Object)

    the current value of total_sending_amount



24
25
26
# File 'lib/sdp/resources/ramps.rb', line 24

def total_sending_amount
  @total_sending_amount
end

Class Method Details

.from_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sdp/resources/ramps.rb', line 28

def self.from_hash(hash)
  hash ||= {}
  new(
    id: hash[:id],
    provider: hash[:provider],
    status: hash[:status],
    delivery_mode: hash[:delivery_mode],
    hosted_url: hash[:hosted_url],
    payment_instructions: hash[:payment_instructions],
    exchange_rate: hash[:exchange_rate],
    total_sending_amount: hash[:total_sending_amount],
    sending_currency: hash[:sending_currency],
    total_receiving_amount: hash[:total_receiving_amount],
    receiving_currency: hash[:receiving_currency],
    fees_included: hash[:fees_included],
    fee_currency: hash[:fee_currency],
    expires_at: hash[:expires_at]
  )
end