Class: RCreds::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/r_creds/fetcher.rb

Defined Under Namespace

Classes: NilValueError, NoRailsError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keys, default, environment, environment_first, allow_nil_value) ⇒ Fetcher

Returns a new instance of Fetcher.



8
9
10
11
12
13
14
# File 'lib/r_creds/fetcher.rb', line 8

def initialize(keys, default, environment, environment_first, allow_nil_value)
  @keys = keys.map!(&:to_sym)
  @default = default
  @environment = environment
  @environment_first = environment_first
  @allow_nil_value = allow_nil_value
end

Instance Attribute Details

#allow_nil_valueObject (readonly)

Returns the value of attribute allow_nil_value.



16
17
18
# File 'lib/r_creds/fetcher.rb', line 16

def allow_nil_value
  @allow_nil_value
end

#cred_valueObject (readonly)

Returns the value of attribute cred_value.



16
17
18
# File 'lib/r_creds/fetcher.rb', line 16

def cred_value
  @cred_value
end

#defaultObject (readonly)

Returns the value of attribute default.



16
17
18
# File 'lib/r_creds/fetcher.rb', line 16

def default
  @default
end

#environment_firstObject (readonly)

Returns the value of attribute environment_first.



16
17
18
# File 'lib/r_creds/fetcher.rb', line 16

def environment_first
  @environment_first
end

#keysObject (readonly)

Returns the value of attribute keys.



16
17
18
# File 'lib/r_creds/fetcher.rb', line 16

def keys
  @keys
end

Instance Method Details

#callObject



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

def call
  check_rails
  fetch
end