Class: Errapi::Locations::Dotted
- Inherits:
-
Object
- Object
- Errapi::Locations::Dotted
- Defined in:
- lib/errapi/locations/dotted.rb
Instance Method Summary collapse
- #===(location) ⇒ Object
-
#initialize(location = nil) ⇒ Dotted
constructor
A new instance of Dotted.
- #location_type ⇒ Object
- #relative(parts) ⇒ Object
- #serialize ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(location = nil) ⇒ Dotted
Returns a new instance of Dotted.
5 6 7 |
# File 'lib/errapi/locations/dotted.rb', line 5 def initialize location = nil @location = location.to_s.sub /^\./, '' unless location.nil? end |
Instance Method Details
#===(location) ⇒ Object
25 26 27 |
# File 'lib/errapi/locations/dotted.rb', line 25 def === location @location.to_s == location.to_s end |
#location_type ⇒ Object
17 18 19 |
# File 'lib/errapi/locations/dotted.rb', line 17 def location_type :dotted end |
#relative(parts) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/errapi/locations/dotted.rb', line 9 def relative parts if @location.nil? self.class.new parts else self.class.new "#{@location}.#{parts.to_s.sub(/^\./, '')}" end end |
#serialize ⇒ Object
21 22 23 |
# File 'lib/errapi/locations/dotted.rb', line 21 def serialize @location.nil? ? nil : @location end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/errapi/locations/dotted.rb', line 29 def to_s @location.to_s end |