Class: RestApi::ResourceNotFound

Inherits:
ActiveResource::ResourceNotFound
  • Object
show all
Defined in:
app/models/rest_api.rb

Direct Known Subclasses

ApplicationType::NotFound

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

#idObject (readonly)

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

Returns:

  • (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

#modelObject



39
40
41
# File 'app/models/rest_api.rb', line 39

def model
  @model.constantize rescue RestApi::Base
end

#to_sObject



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