Exception: Rested::ObjectNotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/rested/error.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#http_response, #message, #reason, #status, #validations

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ ObjectNotFound

Returns a new instance of ObjectNotFound.



47
48
49
50
# File 'lib/rested/error.rb', line 47

def initialize(res)
    super(res)
    self.id = $1 if res.content =~ /Invalid Object.*?(\d+)/
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



45
46
47
# File 'lib/rested/error.rb', line 45

def id
  @id
end

Instance Method Details

#to_sObject



52
53
54
# File 'lib/rested/error.rb', line 52

def to_s
    "Invalid Object ID '#{self.id}'"
end