Module: Musashi::Retriever::Content

Includes:
DelegateHash
Defined in:
lib/musashi/retriever.rb

Instance Attribute Summary

Attributes included from Connection

#endpoint, #format

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DelegateHash

#[], #attrs, #fetch, #key?, #keys, #method_missing

Methods included from VisitorStrategist

#[], #has_key?, #method_missing, #respond_to?

Methods included from Strategist

define, #define, define_by_behavior, define_by_name, #follow?, #no_follow, retrievers_by_behavior, retrievers_by_behavior=, retrievers_by_name, retrievers_by_name=

Methods included from Base

#retrieved?

Methods included from Connection

#accept, #connection, #options

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Musashi::Retriever::DelegateHash

Class Method Details

.extend?(receiver) ⇒ Boolean

Returns:

  • (Boolean)


165
166
167
168
# File 'lib/musashi/retriever.rb', line 165

def self.extend?(receiver)
  !receiver.nil? && receiver.respond_to?(:start_with?) && \
  receiver.start_with?('http') && !receiver.is_a?(Content)
end

.extend_object(receiver) ⇒ Object

Raises:

  • (RuntimeError)


170
171
172
173
174
# File 'lib/musashi/retriever.rb', line 170

def self.extend_object(receiver)
  return if receiver.is_a?(Content)
  raise RuntimeError.new unless Content.extend? receiver
  super
end

Instance Method Details

#retrieveObject



176
177
178
179
# File 'lib/musashi/retriever.rb', line 176

def retrieve
  self.endpoint = to_s
  super
end