Class: Square::Connect::SettlementEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/square/connect/settlement_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SettlementEntry

Returns a new instance of SettlementEntry.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/square/connect/settlement_entry.rb', line 6

def initialize(attributes = {})
  self.type = attributes[:type]
  self.payment = if attributes[:payment_id]
    Payment.new attributes[:payment_id]
  end
  [
    :amount_money,
    :fee_money
  ].each do |money_key|
    if attributes[money_key]
      self.send "#{money_key}=", Money.new(attributes[money_key])
    end
  end
end

Instance Attribute Details

#amount_moneyObject

Returns the value of attribute amount_money.



4
5
6
# File 'lib/square/connect/settlement_entry.rb', line 4

def amount_money
  @amount_money
end

#fee_moneyObject

Returns the value of attribute fee_money.



4
5
6
# File 'lib/square/connect/settlement_entry.rb', line 4

def fee_money
  @fee_money
end

#paymentObject

Returns the value of attribute payment.



4
5
6
# File 'lib/square/connect/settlement_entry.rb', line 4

def payment
  @payment
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/square/connect/settlement_entry.rb', line 4

def type
  @type
end