Class: ListBanks

Inherits:
Base
  • Object
show all
Defined in:
lib/rave_ruby/rave_objects/list_banks.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#get_hashed_key

Instance Method Summary collapse

Methods inherited from Base

#check_passed_parameters, #get_request, #handle_list_bank, #post_request

Constructor Details

#initialize(rave_object) ⇒ ListBanks

method to initialize the object



8
9
10
# File 'lib/rave_ruby/rave_objects/list_banks.rb', line 8

def initialize(rave_object)
    @rave_object = rave_object
end

Instance Attribute Details

#rave_objectObject (readonly)

Returns the value of attribute rave_object.



5
6
7
# File 'lib/rave_ruby/rave_objects/list_banks.rb', line 5

def rave_object
  @rave_object
end

Instance Method Details

#fetch_banksObject

method to fetch the list of banks using the list bank endpoint



13
14
15
16
17
# File 'lib/rave_ruby/rave_objects/list_banks.rb', line 13

def fetch_banks
    base_url = rave_object.base_url
    response = get_request("#{base_url}#{BASE_ENDPOINTS::BANKS_ENDPOINT}", {:json => 1})
    return handle_list_bank(response)
end