Class: ShafClient::EmptyResource

Inherits:
Resource show all
Defined in:
lib/shaf_client/empty_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 = {}) ⇒ EmptyResource

Returns a new instance of EmptyResource.



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

def initialize(_client, _payload, status = nil, headers = {})
  @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

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/shaf_client/empty_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/empty_resource.rb', line 5

def http_status
  @http_status
end

Instance Method Details

#to_hObject



18
19
20
# File 'lib/shaf_client/empty_resource.rb', line 18

def to_h
  {}
end