Class: CIDE::ConfigFileLoader::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/cide/config_file_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Path

Returns a new instance of Path.



5
6
7
# File 'lib/cide/config_file_loader.rb', line 5

def initialize(str)
  @to_s = str.to_s
end

Instance Attribute Details

#to_sObject (readonly)

Returns the value of attribute to_s.



4
5
6
# File 'lib/cide/config_file_loader.rb', line 4

def to_s
  @to_s
end

Instance Method Details

#append(value) ⇒ Object



9
10
11
12
13
# File 'lib/cide/config_file_loader.rb', line 9

def append(value)
  self.class.new(
    @to_s + (value.is_a?(Integer) ? "[#{value}]" : ".#{value}"),
  )
end