Module: Magicka::Helper

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

Overview

Helper module to be used on rails

Defined Under Namespace

Modules: ClassMethods Classes: MethodBuilder

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

with

Class Method Details

.with(aggregator_class, type = aggregator_class.type) ⇒ 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

Returns:

  • (Array<NilClass>)


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

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 43

#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 29