Class: Confy::Backend::SimpleAssignment

Inherits:
Hash
  • Object
show all
Defined in:
lib/confy/backend/simple_assignment.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ SimpleAssignment

Returns a new instance of SimpleAssignment.



11
12
13
# File 'lib/confy/backend/simple_assignment.rb', line 11

def initialize path
  @config = __parse path
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



31
32
33
# File 'lib/confy/backend/simple_assignment.rb', line 31

def method_missing *args
  @config.send args.shift
end

Class Method Details

.comment_pattern(pattern = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/confy/backend/simple_assignment.rb', line 23

def self.comment_pattern pattern=nil
  if pattern
    @comment_pattern = pattern
  end

  @comment_pattern ||= /\A#/
end

.splitter(pattern = nil) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/confy/backend/simple_assignment.rb', line 15

def self.splitter pattern=nil
  if pattern
    @splitter = pattern
  end

  @splitter ||= /=|:/
end