Class: Doze::Resource::Error
- Inherits:
-
Object
- Object
- Doze::Resource::Error
- Includes:
- Doze::Resource, Serialization::Resource
- Defined in:
- lib/doze/resource/error.rb
Instance Attribute Summary
Attributes included from Doze::Resource
Instance Method Summary collapse
- #get_data ⇒ Object
-
#initialize(status = Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, message = Rack::Utils::HTTP_STATUS_CODES[status], extras = {}) ⇒ Error
constructor
A new instance of Error.
Methods included from Serialization::Resource
#accepts_method_with_media_type?, #get, #serialization_media_types
Methods included from Doze::Resource
#accepts_method_with_media_type?, #authorize, #cache_expiry_period, #cacheable?, #delete_resource, #exists?, #get, #last_modified, #other_method, #post, #public_cache_expiry_period, #publicly_cacheable?, #put, #supports_get?, #supports_method?, #try, #uri_object
Constructor Details
#initialize(status = Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, message = Rack::Utils::HTTP_STATUS_CODES[status], extras = {}) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 |
# File 'lib/doze/resource/error.rb', line 12 def initialize(status=Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, =Rack::Utils::HTTP_STATUS_CODES[status], extras={}) @status = status = @extra_properties = extras end |
Instance Method Details
#get_data ⇒ Object
18 19 20 |
# File 'lib/doze/resource/error.rb', line 18 def get_data @extra_properties.merge(:status => @status, :message => ) end |