Class: Musashi::Resource
- Inherits:
-
Object
- Object
- Musashi::Resource
- Includes:
- Musashi
- Defined in:
- lib/musashi.rb,
lib/musashi/resource.rb
Defined Under Namespace
Constant Summary
Constants included from Musashi
Instance Attribute Summary
Attributes included from Connection
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Resource
constructor
A new instance of Resource.
Methods included from Musashi::Retriever::DelegateHash
#[], #attrs, #fetch, #key?, #keys, #method_missing
Methods included from Musashi::Retriever::VisitorStrategist
#[], extend?, extend_object, #has_key?, #method_missing, #respond_to?
Methods included from Musashi::Retriever::Strategist
define, #define, define_by_behavior, define_by_name, extend_object, #follow?, #no_follow, retrievers_by_behavior, retrievers_by_behavior=, retrievers_by_name, retrievers_by_name=
Methods included from Musashi::Retriever::Base
Methods included from Connection
#accept, #connection, #options
Methods included from Publisher
#attributes, marshall, marshalls, #method_missing, #post, #put, #update_attributes
Constructor Details
#initialize(url, options = {}) ⇒ Resource
Returns a new instance of Resource.
52 53 54 55 56 57 |
# File 'lib/musashi/resource.rb', line 52 def initialize(url,={}) raise ArgumentError.new('Undefined url') if url.nil? or url.empty? resource_type = Format.formats[ [:format] || :json ] extend(resource_type) unless resource_type.nil? self.endpoint = url end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Musashi::Retriever::DelegateHash