Class: PromisePay::Fee

Inherits:
Object
  • Object
show all
Includes:
Lib::DynamicAccessors
Defined in:
lib/promise_pay/fee.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Lib::DynamicAccessors

#accessor_defined?, #assign_instance_variables, #define_accessor, #initialize_property, #set_property

Constructor Details

#initialize(options = {}) ⇒ Fee

Returns a new instance of Fee.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/promise_pay/fee.rb', line 21

def initialize(options = {})
  @name         = options.fetch(:name)
  @fee_type_id  = options.fetch(:fee_type_id)
  @amount       = options.fetch(:amount)
  @cap          = options.fetch(:cap)
  @min          = options.fetch(:min)
  @max          = options.fetch(:max)
  @to           = options.fetch(:to)

  assign_instance_variables({'fees' => options})
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



11
12
13
# File 'lib/promise_pay/fee.rb', line 11

def amount
  @amount
end

#capObject (readonly)

Returns the value of attribute cap.



12
13
14
# File 'lib/promise_pay/fee.rb', line 12

def cap
  @cap
end

#fee_type_idObject (readonly)

Returns the value of attribute fee_type_id.



10
11
12
# File 'lib/promise_pay/fee.rb', line 10

def fee_type_id
  @fee_type_id
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/promise_pay/fee.rb', line 8

def id
  @id
end

#maxObject (readonly)

Returns the value of attribute max.



14
15
16
# File 'lib/promise_pay/fee.rb', line 14

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



13
14
15
# File 'lib/promise_pay/fee.rb', line 13

def min
  @min
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/promise_pay/fee.rb', line 9

def name
  @name
end

#toObject (readonly)

Returns the value of attribute to.



15
16
17
# File 'lib/promise_pay/fee.rb', line 15

def to
  @to
end

Class Method Details

.create(options = {}) ⇒ Object



17
18
19
# File 'lib/promise_pay/fee.rb', line 17

def self.create(options = {})
  new(options).create
end

Instance Method Details

#createObject



33
34
35
36
# File 'lib/promise_pay/fee.rb', line 33

def create
  assign_instance_variables(resource_result)
  self
end