Module: VantivSFTPReports

Defined in:
lib/vantiv_sftp_reports.rb,
lib/vantiv_sftp_reports/fetch.rb,
lib/vantiv_sftp_reports/config.rb,
lib/vantiv_sftp_reports/version.rb

Defined Under Namespace

Classes: Config, Fetch

Constant Summary collapse

MAJOR =
0
MINOR =
2
TINY =
0
VERSION =
[MAJOR, MINOR, TINY].join('.').freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_configObject (readonly)

Returns the value of attribute default_config.



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

def default_config
  @default_config
end

.default_fetchObject (readonly)

Returns the value of attribute default_fetch.



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

def default_fetch
  @default_fetch
end

Class Method Details

.call(*args) ⇒ Object Also known as: fetch



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

def call(*args)
  default_fetch.(*args)
end

.configure(config = env_config) ⇒ Object



18
19
20
21
# File 'lib/vantiv_sftp_reports.rb', line 18

def configure(config = env_config)
  @default_config = Config.with_obj(config)
  @default_fetch = Fetch.new(@default_config)
end

.env_configObject



23
24
25
26
27
28
# File 'lib/vantiv_sftp_reports.rb', line 23

def env_config
  ENV.each_with_object({}) do |(k, v), h|
    next unless k.index('vantiv_sftp_') == 0
    h[k[12..-1].to_sym] = v
  end
end

.first(*args) ⇒ Object



30
31
32
# File 'lib/vantiv_sftp_reports.rb', line 30

def first(*args)
  default_fetch.first(*args)
end

.versionObject



9
10
11
# File 'lib/vantiv_sftp_reports/version.rb', line 9

def self.version
  VERSION
end