Class: LazyGraph::PathParser::PathPart
- Inherits:
-
Struct
- Object
- Struct
- LazyGraph::PathParser::PathPart
- Defined in:
- lib/lazy_graph/path_parser/path_part.rb
Overview
Represents a single part of a path.
Instance Attribute Summary collapse
-
#part ⇒ Object
Returns the value of attribute part.
Instance Method Summary collapse
Instance Attribute Details
#part ⇒ Object
Returns the value of attribute part
7 8 9 |
# File 'lib/lazy_graph/path_parser/path_part.rb', line 7 def part @part end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lazy_graph/path_parser/path_part.rb', line 12 def ==(other) return part == other.to_sym if other.is_a?(String) return part == other if other.is_a?(Symbol) return part == other if other.is_a?(Array) super end |
#index? ⇒ Boolean
8 9 10 |
# File 'lib/lazy_graph/path_parser/path_part.rb', line 8 def index? @index ||= part =~ INDEX_REGEXP end |