Class: Esirb::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/esirb/path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil) ⇒ Path

Returns a new instance of Path.



7
8
9
10
# File 'lib/esirb/path.rb', line 7

def initialize(client: nil)
  @client = client
  @string = ""
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/esirb/path.rb', line 22

def method_missing(m, *args, &block)
  @string += "/#{m}"
  args.each do |arg|
    @string += "/#{arg}"
  end

  self
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/esirb/path.rb', line 5

def client
  @client
end

#stringObject (readonly)

Returns the value of attribute string.



5
6
7
# File 'lib/esirb/path.rb', line 5

def string
  @string
end