class Patterns::Collection

Attributes

options[R]
subject[R]

Public Class Methods

for(*args)
Alias for: new
from(*args)
Alias for: new
new(*args) click to toggle source
# File lib/patterns/collection.rb, line 5
def initialize(*args)
  @options = args.extract_options!
  @subject = args.first
end
Also aliased as: from, for

Public Instance Methods

each() { |*args| ... } click to toggle source
# File lib/patterns/collection.rb, line 10
def each
  collection.each do |*args|
    yield(*args)
  end
end

Private Instance Methods

collection() click to toggle source
# File lib/patterns/collection.rb, line 25
def collection
  raise NotImplementedError, "#collection not implemented"
end