Class: Giftrocket::FundingSource

Inherits:
Object
  • Object
show all
Defined in:
lib/giftrocket/funding_source.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ FundingSource

Returns a new instance of FundingSource.



6
7
8
9
10
11
# File 'lib/giftrocket/funding_source.rb', line 6

def initialize(attributes)
  attributes = attributes.with_indifferent_access
  self.id = attributes[:id]
  self.method = attributes[:method]
  self.meta = attributes[:meta]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/giftrocket/funding_source.rb', line 4

def id
  @id
end

#metaObject

Returns the value of attribute meta.



4
5
6
# File 'lib/giftrocket/funding_source.rb', line 4

def meta
  @meta
end

#methodObject

Returns the value of attribute method.



4
5
6
# File 'lib/giftrocket/funding_source.rb', line 4

def method
  @method
end

Class Method Details

.list(filters = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/giftrocket/funding_source.rb', line 13

def self.list(filters={})
  Giftrocket::Request.get(
    'funding_sources',
    query: filters.merge(Giftrocket.default_options),
    format: 'json'
  )[:funding_sources].map do |funding_souce_attributes|
    Giftrocket::FundingSource.new(funding_souce_attributes)
  end
end