Class: GroupBy

Inherits:
Ruby::Node show all
Defined in:
lib/linqr.rb

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ GroupBy

Returns a new instance of GroupBy.



39
40
41
# File 'lib/linqr.rb', line 39

def initialize(node)
  @node = node
end

Instance Method Details

#expressionObject



42
43
44
45
# File 'lib/linqr.rb', line 42

def expression
  return @node.arg.first.key if @node.arg.is_a? Ruby::Hash
  @node
end

#grouping_varObject



46
47
48
# File 'lib/linqr.rb', line 46

def grouping_var
  @node.arg.first.value.first.to_sym
end