class Errapi::Locations::Json

Public Class Methods

new(location = nil) click to toggle source
# File lib/errapi/locations/json.rb, line 5
def initialize location = nil
  @location = location.nil? ? '' : "/#{location.to_s.sub(/^\//, '').sub(/\/$/, '')}"
end

Public Instance Methods

===(location) click to toggle source
# File lib/errapi/locations/json.rb, line 25
def === location
  @location.to_s == location.to_s
end
location_type() click to toggle source
# File lib/errapi/locations/json.rb, line 17
def location_type
  :json
end
relative(parts) click to toggle source
# File lib/errapi/locations/json.rb, line 9
def relative parts
  if @location.nil?
    self.class.new parts
  else
    self.class.new "#{@location}/#{parts.to_s.sub(/^\./, '').sub(/\/$/, '')}"
  end
end
serialize() click to toggle source
# File lib/errapi/locations/json.rb, line 21
def serialize
  @location
end
to_s() click to toggle source
# File lib/errapi/locations/json.rb, line 29
def to_s
  @location
end