Class: Cardiac::Resource
- Inherits:
-
Object
- Object
- Cardiac::Resource
- Includes:
- CodecMethods, ConfigMethods, ExtensionMethods, RequestMethods, UriMethods
- Defined in:
- lib/cardiac/resource.rb
Direct Known Subclasses
Constant Summary
Constants included from CodecMethods
CodecMethods::DEFAULT_DECODERS
Constants included from RequestMethods
Cardiac::RequestMethods::DEFAULT_ACCEPTS
Instance Attribute Summary collapse
-
#accepts_values ⇒ Object
Returns the value of attribute accepts_values.
-
#base_value ⇒ Object
Returns the value of attribute base_value.
-
#decoders_values ⇒ Object
Returns the value of attribute decoders_values.
-
#encoder_handler_value ⇒ Object
Returns the value of attribute encoder_handler_value.
-
#encoder_search_value ⇒ Object
Returns the value of attribute encoder_search_value.
-
#extensions_values ⇒ Object
Returns the value of attribute extensions_values.
-
#headers_values ⇒ Object
Returns the value of attribute headers_values.
-
#host_value ⇒ Object
Returns the value of attribute host_value.
-
#https_value ⇒ Object
Returns the value of attribute https_value.
-
#method_value ⇒ Object
Returns the value of attribute method_value.
-
#operations_values ⇒ Object
Returns the value of attribute operations_values.
-
#options_values ⇒ Object
Returns the value of attribute options_values.
-
#password_value ⇒ Object
Returns the value of attribute password_value.
-
#path_values ⇒ Object
Returns the value of attribute path_values.
-
#port_value ⇒ Object
Returns the value of attribute port_value.
-
#query_values ⇒ Object
Returns the value of attribute query_values.
-
#subresources_values ⇒ Object
Returns the value of attribute subresources_values.
-
#user_value ⇒ Object
Returns the value of attribute user_value.
Instance Method Summary collapse
-
#initialize(base) ⇒ Resource
constructor
A new instance of Resource.
- #to_reflection(verb = method_value) ⇒ Object
- #to_resource ⇒ Object
- #to_s ⇒ Object
Methods included from ConfigMethods
Methods included from ExtensionMethods
#__extension_defined__?, #__extension_module__, #extending, #operation, #subresource
Methods included from CodecMethods
#decoders, #encoder, #reset_decoders
Methods included from RequestMethods
#accepts, #at, #header, #headers, #http_method, #option, #options, #request_has_body?, #request_is_idemptotent?, #request_is_safe?, #reset_headers, #reset_options, #response_has_body?
Methods included from UriMethods
#at, #host, #http, #http_method, #https, #password, #path, #port, #query, #reset_query, #scheme, #ssl, #to_relative_uri, #to_relative_url, #to_uri, #to_url, #user, #userinfo
Constructor Details
#initialize(base) ⇒ Resource
Returns a new instance of Resource.
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cardiac/resource.rb', line 35 def initialize(base) self.base_value = ::URI::Generic===base ? base.dup : URI(base) # compatibility with 1.9.2 and below self.path_values = [] self.query_values = [] self.headers_values = [] self.accepts_values = [] self. = [] self.decoders_values = [] self.operations_values = [] self.subresources_values = [] self.extensions_values = [] extract_from_base! end |
Instance Attribute Details
#accepts_values ⇒ Object
Returns the value of attribute accepts_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def accepts_values @accepts_values end |
#base_value ⇒ Object
Returns the value of attribute base_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def base_value @base_value end |
#decoders_values ⇒ Object
Returns the value of attribute decoders_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def decoders_values @decoders_values end |
#encoder_handler_value ⇒ Object
Returns the value of attribute encoder_handler_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def encoder_handler_value @encoder_handler_value end |
#encoder_search_value ⇒ Object
Returns the value of attribute encoder_search_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def encoder_search_value @encoder_search_value end |
#extensions_values ⇒ Object
Returns the value of attribute extensions_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def extensions_values @extensions_values end |
#headers_values ⇒ Object
Returns the value of attribute headers_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def headers_values @headers_values end |
#host_value ⇒ Object
Returns the value of attribute host_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def host_value @host_value end |
#https_value ⇒ Object
Returns the value of attribute https_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def https_value @https_value end |
#method_value ⇒ Object
Returns the value of attribute method_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def method_value @method_value end |
#operations_values ⇒ Object
Returns the value of attribute operations_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def operations_values @operations_values end |
#options_values ⇒ Object
Returns the value of attribute options_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def @options_values end |
#password_value ⇒ Object
Returns the value of attribute password_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def password_value @password_value end |
#path_values ⇒ Object
Returns the value of attribute path_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def path_values @path_values end |
#port_value ⇒ Object
Returns the value of attribute port_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def port_value @port_value end |
#query_values ⇒ Object
Returns the value of attribute query_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def query_values @query_values end |
#subresources_values ⇒ Object
Returns the value of attribute subresources_values.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def subresources_values @subresources_values end |
#user_value ⇒ Object
Returns the value of attribute user_value.
7 8 9 |
# File 'lib/cardiac/resource.rb', line 7 def user_value @user_value end |
Instance Method Details
#to_reflection(verb = method_value) ⇒ Object
57 58 59 |
# File 'lib/cardiac/resource.rb', line 57 def to_reflection(verb=method_value) ResourceReflection.new(to_resource, verb) end |
#to_resource ⇒ Object
49 50 51 |
# File 'lib/cardiac/resource.rb', line 49 def to_resource self end |
#to_s ⇒ Object
53 54 55 |
# File 'lib/cardiac/resource.rb', line 53 def to_s to_url end |