Class: Sdp::RampCurrencies

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

Overview

Currency discovery for a ramp direction: which fiat/crypto SDP can move between and which providers serve each pair. Passed through close to how SDP reports it — pairs is an array of { source, dest, providers } hashes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#destinationsObject

Returns the value of attribute destinations

Returns:

  • (Object)

    the current value of destinations



7
8
9
# File 'lib/sdp/resources/ramps.rb', line 7

def destinations
  @destinations
end

#pairsObject

Returns the value of attribute pairs

Returns:

  • (Object)

    the current value of pairs



7
8
9
# File 'lib/sdp/resources/ramps.rb', line 7

def pairs
  @pairs
end

#sourcesObject

Returns the value of attribute sources

Returns:

  • (Object)

    the current value of sources



7
8
9
# File 'lib/sdp/resources/ramps.rb', line 7

def sources
  @sources
end

#support_hashObject

Returns the value of attribute support_hash

Returns:

  • (Object)

    the current value of support_hash



7
8
9
# File 'lib/sdp/resources/ramps.rb', line 7

def support_hash
  @support_hash
end

Class Method Details

.from_hash(hash) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/sdp/resources/ramps.rb', line 8

def self.from_hash(hash)
  hash ||= {}
  currencies = hash[:currencies] || {}
  new(
    sources: currencies[:sources] || [],
    destinations: currencies[:destinations] || [],
    pairs: hash[:pairs] || [],
    support_hash: hash[:support_hash]
  )
end