Class: RestApi::ResourceNotFound
- Inherits:
-
ActiveResource::ResourceNotFound
- Object
- ActiveResource::ResourceNotFound
- RestApi::ResourceNotFound
show all
- Defined in:
- app/models/rest_api.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(model, id, response = nil) ⇒ ResourceNotFound
Returns a new instance of ResourceNotFound.
35
36
37
38
|
# File 'app/models/rest_api.rb', line 35
def initialize(model, id, response=nil)
@id, @model = id, model
super(response)
end
|
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
34
35
36
|
# File 'app/models/rest_api.rb', line 34
def id
@id
end
|
Instance Method Details
#domain_missing? ⇒ Boolean
42
43
44
|
# File 'app/models/rest_api.rb', line 42
def domain_missing?
@model == 'Domain' || RestApi::Base.remote_errors_for(response).any?{ |m| m[0] == 127 } rescue false
end
|
#model ⇒ Object
39
40
41
|
# File 'app/models/rest_api.rb', line 39
def model
@model.constantize rescue RestApi::Base
end
|
#to_s ⇒ Object
45
46
47
|
# File 'app/models/rest_api.rb', line 45
def to_s
"#{model.to_s.titleize}#{ " '#{id}'" unless id.nil?} does not exist"
end
|