Module: Musashi::Retriever::DelegateHash

Includes:
VisitorStrategist
Included in:
Musashi::Retriever, Content
Defined in:
lib/musashi/retriever.rb

Instance Attribute Summary

Attributes included from Connection

#endpoint, #format

Instance Method Summary collapse

Methods included from VisitorStrategist

extend?, extend_object, #has_key?, #respond_to?

Methods included from 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 Base

#retrieve, #retrieved?

Methods included from Connection

#accept, #connection, #options

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



138
139
140
141
# File 'lib/musashi/retriever.rb', line 138

def method_missing(sym,*args,&block)
  attrs
  super
end

Instance Method Details

#[](key) ⇒ Object



133
134
135
136
# File 'lib/musashi/retriever.rb', line 133

def [](key)
  attrs
  super
end

#attrsObject



155
156
157
158
# File 'lib/musashi/retriever.rb', line 155

def attrs
  @attrs = retrieve unless retrieved?
  @attrs
end

#fetch(*args) ⇒ Object



151
152
153
# File 'lib/musashi/retriever.rb', line 151

def fetch(*args)
  attrs.fetch(*args)
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


147
148
149
# File 'lib/musashi/retriever.rb', line 147

def key?(key)
  attrs.key?(key)
end

#keysObject



143
144
145
# File 'lib/musashi/retriever.rb', line 143

def keys
  attrs.keys
end