module ROM::Relation::Materializable

Interface for objects that can be materialized into a loaded relation

@api public

Public Instance Methods

each() { |tuple| ... } click to toggle source

Yield relation tuples

@yield [Hash,Object]

@api public

# File lib/rom/relation/materializable.rb, line 24
def each
  return to_enum unless block_given?

  to_a.each { |tuple| yield(tuple) }
end
first() click to toggle source

Return first tuple from a relation coerced to an array

@return [Object]

@api public

# File lib/rom/relation/materializable.rb, line 57
def first
  to_a.first
end
one() click to toggle source

Delegate to loaded relation and return one object

@return [Object]

@see Loaded#one

@api public

# File lib/rom/relation/materializable.rb, line 37
def one
  call.one
end
one!() click to toggle source

Delegate to loaded relation and return one object

@return [Object]

@see Loaded#one

@api public

# File lib/rom/relation/materializable.rb, line 48
def one!
  call.one!
end
to_a() click to toggle source

Coerce the relation to an array

@return [Array]

@api public

# File lib/rom/relation/materializable.rb, line 14
def to_a
  call.to_a
end
Also aliased as: to_ary
to_ary()
Alias for: to_a