Class: BloomRemit2::Partner

Inherits:
Object
  • Object
show all
Defined in:
lib/bloom_remit2/partner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, slug, domain, active, orig_currency, dest_currency, min_amount_in_orig_currency, max_amount_in_orig_currency, website, zip_code, country, phone, email, flat_fee_in_orig_currency, forex_margin, agent_ids, credit_in_php, credit_in_vnd) ⇒ Partner

Returns a new instance of Partner.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/bloom_remit2/partner.rb', line 38

def initialize(
  id,
  name,
  slug,
  domain,
  active,
  orig_currency,
  dest_currency,
  min_amount_in_orig_currency,
  max_amount_in_orig_currency,
  website,
  zip_code,
  country,
  phone,
  email,
  flat_fee_in_orig_currency,
  forex_margin,
  agent_ids,
  credit_in_php,
  credit_in_vnd
)
  @id = id
  @name = name
  @slug = slug
  @domain = domain
  @active = active
  @orig_currency = orig_currency
  @dest_currency = dest_currency
  @min_amount_in_orig_currency = min_amount_in_orig_currency
  @max_amount_in_orig_currency = max_amount_in_orig_currency
  @website = website
  @zip_code = zip_code
  @country = country
  @phone = phone
  @email = email
  @flat_fee_in_orig_currency = flat_fee_in_orig_currency
  @forex_margin = forex_margin
  @agent_ids = agent_ids
  @credit_in_php = credit_in_php
  @credit_in_vnd = credit_in_vnd
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def active
  @active
end

#agent_idsObject (readonly)

Returns the value of attribute agent_ids.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def agent_ids
  @agent_ids
end

#countryObject (readonly)

Returns the value of attribute country.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def country
  @country
end

#credit_in_phpObject (readonly)

Returns the value of attribute credit_in_php.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def credit_in_php
  @credit_in_php
end

#credit_in_vndObject (readonly)

Returns the value of attribute credit_in_vnd.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def credit_in_vnd
  @credit_in_vnd
end

#dest_currencyObject (readonly)

Returns the value of attribute dest_currency.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def dest_currency
  @dest_currency
end

#domainObject (readonly)

Returns the value of attribute domain.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def domain
  @domain
end

#emailObject (readonly)

Returns the value of attribute email.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def email
  @email
end

#flat_fee_in_orig_currencyObject (readonly)

Returns the value of attribute flat_fee_in_orig_currency.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def flat_fee_in_orig_currency
  @flat_fee_in_orig_currency
end

#forex_marginObject (readonly)

Returns the value of attribute forex_margin.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def forex_margin
  @forex_margin
end

#idObject (readonly)

Returns the value of attribute id.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def id
  @id
end

#max_amount_in_orig_currencyObject (readonly)

Returns the value of attribute max_amount_in_orig_currency.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def max_amount_in_orig_currency
  @max_amount_in_orig_currency
end

#min_amount_in_orig_currencyObject (readonly)

Returns the value of attribute min_amount_in_orig_currency.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def min_amount_in_orig_currency
  @min_amount_in_orig_currency
end

#nameObject (readonly)

Returns the value of attribute name.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def name
  @name
end

#orig_currencyObject (readonly)

Returns the value of attribute orig_currency.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def orig_currency
  @orig_currency
end

#phoneObject (readonly)

Returns the value of attribute phone.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def phone
  @phone
end

#slugObject (readonly)

Returns the value of attribute slug.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def slug
  @slug
end

#websiteObject (readonly)

Returns the value of attribute website.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def website
  @website
end

#zip_codeObject (readonly)

Returns the value of attribute zip_code.



36
37
38
# File 'lib/bloom_remit2/partner.rb', line 36

def zip_code
  @zip_code
end

Class Method Details

.retrieveObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bloom_remit2/partner.rb', line 4

def retrieve
  response = Client.get(path).with_indifferent_access
  new(
    response[:id],
    response[:name],
    response[:slug],
    response[:domain],
    response[:active],
    response[:orig_currency],
    response[:dest_currency],
    response[:min_amount_in_orig_currency],
    response[:max_amount_in_orig_currency],
    response[:website],
    response[:zip_code],
    response[:country],
    response[:phone],
    response[:email],
    response[:flat_fee_in_orig_currency],
    response[:forex_margin],
    response[:agent_ids],
    response[:credit_in_php],
    response[:credit_in_vnd]
  )
end