Class: ShafClient::UnknownResource

Inherits:
Resource show all
Defined in:
lib/shaf_client/unknown_resource.rb

Constant Summary

Constants included from MimeTypes

MimeTypes::DEFAULT_ADAPTER, MimeTypes::MIME_TYPE_HAL, MimeTypes::MIME_TYPE_JSON

Instance Attribute Summary collapse

Attributes inherited from BaseResource

#attributes, #curies, #embedded_resources, #links

Instance Method Summary collapse

Methods inherited from Resource

build, content_type, #destroy!, #get, #get_doc, #get_hal_form, #inspect, profile, #reload!

Methods inherited from BaseResource

#[], #actions, #attribute, #curie, #embedded, #inspect, #link, #rel?, #to_s

Constructor Details

#initialize(_client, payload, status = nil, headers = {}) ⇒ UnknownResource

Returns a new instance of UnknownResource.



9
10
11
12
13
14
15
16
17
# File 'lib/shaf_client/unknown_resource.rb', line 9

def initialize(_client, payload, status = nil, headers = {})
  @body = payload.freeze
  @http_status = status
  @headers = headers
  @attributes = {}.freeze
  @links = {}.freeze
  @curies = {}.freeze
  @embedded_resources = {}.freeze
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShafClient::BaseResource

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/shaf_client/unknown_resource.rb', line 5

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/shaf_client/unknown_resource.rb', line 5

def headers
  @headers
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



5
6
7
# File 'lib/shaf_client/unknown_resource.rb', line 5

def http_status
  @http_status
end

Instance Method Details

#to_hObject



19
20
21
# File 'lib/shaf_client/unknown_resource.rb', line 19

def to_h
  {}
end