Module: Musashi::Retriever::Iterator

Defined in:
lib/musashi/retriever.rb

Class Method Summary collapse

Class Method Details

.extend?(receiver) ⇒ Boolean

Returns:

  • (Boolean)


184
185
186
# File 'lib/musashi/retriever.rb', line 184

def self.extend?(receiver)
  !receiver.nil? && receiver.is_a?(::Array) && !receiver.is_a?(Iterator)
end

.extend_object(receiver) ⇒ Object

Raises:

  • (RuntimeError)


188
189
190
191
192
193
# File 'lib/musashi/retriever.rb', line 188

def self.extend_object(receiver)
  return if receiver.is_a?(Iterator)
  raise RuntimeError.new unless Iterator.extend? receiver
  receiver.each{ |item| Strategist.define(item) }
  super
end