Class: Settings::DataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/settings/data_source.rb,
lib/settings/data_source/env.rb,
lib/settings/data_source/file.rb,
lib/settings/data_source/hash.rb,
lib/settings/data_source/build.rb

Direct Known Subclasses

Env, File, Hash

Defined Under Namespace

Modules: Build Classes: Env, File, Hash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ DataSource

Returns a new instance of DataSource.



5
6
7
# File 'lib/settings/data_source.rb', line 5

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



3
4
5
# File 'lib/settings/data_source.rb', line 3

def source
  @source
end

Class Method Details

.build(source = nil) ⇒ Object



9
10
11
12
13
# File 'lib/settings/data_source.rb', line 9

def self.build(source=nil)
  source = canonize(source) if respond_to? :canonize

  new(source)
end