Class: Buff::Config::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
VariaModel
Defined in:
lib/buff/config.rb

Direct Known Subclasses

JSON, Ruby

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil, attributes = {}) ⇒ Base

Returns a new instance of Base.

Parameters:

  • path (String) (defaults to: nil)
  • attributes (Hash) (defaults to: {})


21
22
23
24
25
# File 'lib/buff/config.rb', line 21

def initialize(path = nil, attributes = {})
  @path = File.expand_path(path) if path

  mass_assign(attributes)
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#to_hashObject



27
28
29
# File 'lib/buff/config.rb', line 27

def to_hash
  super.deep_symbolize_keys
end