Class: SynapseClient::MassPay

Inherits:
APIResource show all
Defined in:
lib/synapse_client/mass_pay.rb

Instance Attribute Summary collapse

Attributes inherited from APIResource

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResource

api_resource_name, class_name, #refresh, retrieve, #successful?, #to_hash, url, #url

Constructor Details

#initialize(options = {}) ⇒ MassPay

Returns a new instance of MassPay.



11
12
13
14
15
# File 'lib/synapse_client/mass_pay.rb', line 11

def initialize(options = {})
  options = Map.new(options)

  update_attributes(options)
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



5
6
7
# File 'lib/synapse_client/mass_pay.rb', line 5

def amount
  @amount
end

#dest_bank_idObject (readonly)

Returns the value of attribute dest_bank_id.



8
9
10
# File 'lib/synapse_client/mass_pay.rb', line 8

def dest_bank_id
  @dest_bank_id
end

#source_bank_idObject (readonly)

Returns the value of attribute source_bank_id.



7
8
9
# File 'lib/synapse_client/mass_pay.rb', line 7

def source_bank_id
  @source_bank_id
end

#trans_typeObject (readonly)

Returns the value of attribute trans_type.



6
7
8
# File 'lib/synapse_client/mass_pay.rb', line 6

def trans_type
  @trans_type
end

Class Method Details

.create(params = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/synapse_client/mass_pay.rb', line 17

def self.create(params={})
  response = SynapseClient.request(:post, url + "add", params)

  return response unless response.successful?
  response.data.mass_pays.map do |mp|
    MassPay.new(mp)
  end
end

Instance Method Details

#update_attributes(options) ⇒ Object



27
28
29
30
31
32
# File 'lib/synapse_client/mass_pay.rb', line 27

def update_attributes(options)
  @amount         = options[:amount]
  @trans_type     = options[:trans_type]
  @source_bank_id = options[:source_bank_id].to_i
  @dest_bank_id   = options[:dest_bank_id].to_i
end