Class: Nidyx::Pointer
- Inherits:
-
Object
- Object
- Nidyx::Pointer
- Defined in:
- lib/nidyx/pointer.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(str) ⇒ Pointer
constructor
A new instance of Pointer.
- #to_s ⇒ Object
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
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/nidyx/pointer.rb', line 4 def path @path end |
#source ⇒ Object (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_s ⇒ Object
12 13 14 15 |
# File 'lib/nidyx/pointer.rb', line 12 def to_s puts "source: #{source}" puts "path: #{path}" end |