Class: ActionBlocks::BarchartGroupBuilder

Inherits:
BaseBuilder
  • Object
show all
Defined in:
lib/action_blocks/builders/barchart_builder.rb

Instance Attribute Summary

Attributes inherited from BaseBuilder

#dsl_delegate, #id

Instance Method Summary collapse

Methods inherited from BaseBuilder

#after_build, #after_load, array_fields, block_type, builds, builds_many, delegate_class, #evaluate, #freeze, includes_scheme_helpers, #initialize, #is_block?, #key, references, sets, sets_many, #ui_reference, #valid?

Constructor Details

This class inherits a constructor from ActionBlocks::BaseBuilder

Instance Method Details

#before_build(parent, *args) ⇒ Object



33
34
35
36
37
# File 'lib/action_blocks/builders/barchart_builder.rb', line 33

def before_build(parent, *args)
  @column = args[0]
  @order_by = :ascending
  @grouping_by = :equal_values
end

#hashify(user) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/action_blocks/builders/barchart_builder.rb', line 39

def hashify(user)
  {
    column: @column,
    order_by: @order_by,
    grouping_by: @grouping_by
  }
end