Class: Nidyx::Pointer

Inherits:
Object
  • Object
show all
Defined in:
lib/nidyx/pointer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Pointer

Returns a new instance of Pointer.



6
7
8
9
10
# File 'lib/nidyx/pointer.rb', line 6

def initialize(str)
  match = /^(?<source>.*)#\/*(?<path>.*)$/.match(str)
  @source = match[:source]
  @path = match[:path].split("/")
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/nidyx/pointer.rb', line 4

def path
  @path
end

#sourceObject (readonly)

Returns the value of attribute source.



4
5
6
# File 'lib/nidyx/pointer.rb', line 4

def source
  @source
end

Instance Method Details

#to_sObject



12
13
14
15
# File 'lib/nidyx/pointer.rb', line 12

def to_s
  puts "source: #{source}"
  puts "path: #{path}"
end