Class: BSB::BaseGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/bsb/base_generator.rb

Direct Known Subclasses

BankListGenerator, DatabaseGenerator

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ BaseGenerator

Returns a new instance of BaseGenerator.



8
9
10
# File 'lib/bsb/base_generator.rb', line 8

def initialize(hash)
  @hash = hash
end

Class Method Details

.latest_file(matching_filename:, file_format:) ⇒ Object



16
17
18
19
# File 'lib/bsb/base_generator.rb', line 16

def self.latest_file(matching_filename:, file_format:)
  client = ::Auspaynet::Client.new('bsb.hostedftp.com')
  client.list(dir: '~auspaynetftp/BSB', matching_filename: matching_filename, file_format: file_format)&.last
end

Instance Method Details

#jsonObject



12
13
14
# File 'lib/bsb/base_generator.rb', line 12

def json
  JSON.pretty_generate(@hash)
end