Class: Alf::Algebra::Rank

Inherits:
Object
  • Object
show all
Includes:
Operator, Relational, Unary
Defined in:
lib/alf-algebra/alf/algebra/operator/rank.rb

Instance Attribute Summary

Attributes included from Operator

#operands

Attributes included from Support::Bindable

#connection

Instance Method Summary collapse

Methods included from Operator

#==, #bind, #dup, included, #initialize, #signature, #to_lispy, #to_relvar, #with_operands

Methods included from Support::Registry

#each, #listen, #listeners, #register, #registered

Methods included from Operand

#attr_list, coerce, #to_cog, #to_dot, #to_relation

Methods included from Support::Bindable

#bind, #bound?, #connection!

Methods included from Relational

included

Methods included from Unary

included, #operand, #with_operand

Instance Method Details

#headingObject



11
12
13
# File 'lib/alf-algebra/alf/algebra/operator/rank.rb', line 11

def heading
  @heading ||= operand.heading.merge(as => Integer)
end

#keysObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/alf-algebra/alf/algebra/operator/rank.rb', line 15

def keys
  @keys ||= begin
    keys, order_attrs = operand.keys, order.to_attr_list
    if keys.any?{|k| order_attrs.superset?(k)}
      keys + [ AttrList[as] ]
    else
      keys
    end
  end
end