Sha256: 34420501cadf93cf67f4e228afcf1bee9dd1c5f04dd963bece94d15ff31e473c

Contents?: true

Size: 372 Bytes

Versions: 27

Compression:

Stored size: 372 Bytes

Contents

class OneOrMany < SimpleDelegator

  delegate :is_a?, to: :__getobj__

  def map(&block)
    if __getobj__.respond_to?(:map)
      __getobj__.map(&block)
    else
      yield __getobj__
    end
  end

  def select(&block)
    if __getobj__.respond_to?(:select)
      __getobj__.select(&block)
    else
      return [] unless yield __getobj__
      self
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
houston-core-0.9.2 app/presenters/one_or_many.rb
houston-core-0.9.1 app/presenters/one_or_many.rb
houston-core-0.9.0 app/presenters/one_or_many.rb
houston-core-0.9.0.rc1 app/presenters/one_or_many.rb
houston-core-0.8.4 app/presenters/one_or_many.rb
houston-core-0.8.3 app/presenters/one_or_many.rb
houston-core-0.8.2 app/presenters/one_or_many.rb
houston-core-0.8.1 app/presenters/one_or_many.rb
houston-core-0.8.0 app/presenters/one_or_many.rb
houston-core-0.8.0.pre2 app/presenters/one_or_many.rb
houston-core-0.8.0.pre app/presenters/one_or_many.rb
houston-core-0.7.0 app/presenters/one_or_many.rb
houston-core-0.7.0.beta4 app/presenters/one_or_many.rb
houston-core-0.7.0.beta3 app/presenters/one_or_many.rb
houston-core-0.7.0.beta2 app/presenters/one_or_many.rb
houston-core-0.7.0.beta app/presenters/one_or_many.rb
houston-core-0.6.3 app/presenters/one_or_many.rb
houston-core-0.6.2 app/presenters/one_or_many.rb
houston-core-0.6.1 app/presenters/one_or_many.rb
houston-core-0.6.0 app/presenters/one_or_many.rb