Class: Juvet::Configuration::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/juvet/configuration/adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Adapter



8
9
10
11
12
13
14
# File 'lib/juvet/configuration/adapter.rb', line 8

def initialize(options={})
  opts = default_options.merge((options || {}))

  @type = opts.delete :type
  @options = opts
  @class_name = Juvet::String.new("#{type}_adapter").classify
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



4
5
6
# File 'lib/juvet/configuration/adapter.rb', line 4

def class_name
  @class_name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/juvet/configuration/adapter.rb', line 5

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/juvet/configuration/adapter.rb', line 6

def type
  @type
end

Instance Method Details

#build(mapper) ⇒ Object



16
17
18
19
# File 'lib/juvet/configuration/adapter.rb', line 16

def build(mapper)
  load_adapter
  instantiate_adapter mapper
end