Module: Magicka::Helper

Extended by:
ClassMethods
Defined in:
lib/magicka/helper.rb,
lib/magicka/helper/class_methods.rb,
lib/magicka/helper/method_builder.rb,
lib/magicka/helper/aggregator_options.rb

Overview

Helper module to be used on rails

Defined Under Namespace

Modules: ClassMethods Classes: AggregatorOptions, MethodBuilder

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

with

Class Method Details

.with(aggregator_class, type = aggregator_class.type, &config_block) ⇒ Array<NilClass>

Adds a helper method magicka_type

The created method executes a block with a an aggragator

Parameters:

  • aggregator_class (Class<Magicka::Aggregator>)

    Agragator to be initialized

  • type (String, Symbol) (defaults to: aggregator_class.type)

    type of aggregator, this will define the method name

  • config_block (Proc)

    block to be evaluated and configure the aggregator when it is first used

Returns:

  • (Array<NilClass>)


# File 'lib/magicka/helper.rb', line 17

Instance Method Details

#magicka_display(model) {|Magicka::Display| ... } ⇒ String

Execute a block with an aggregator focused on a model

The aggregator renders elements as display elements

Parameters:

  • model (String)

    Model to be processed

Yields:

Returns:

  • (String)

See Also:



# File 'lib/magicka/helper.rb', line 48

#magicka_form(model) {|Magicka::Form| ... } ⇒ String

Execute a block with an aggregator focused on a model

The aggregator renders elements as form elements

Parameters:

  • model (String)

    Model to be processed

Yields:

Returns:

  • (String)

See Also:



# File 'lib/magicka/helper.rb', line 33