Sha256: 83e1fc235cdfd71eb14161562a995265186f2ee50a90b6497535296baef8c73c

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

# frozen_string_literal: true

module Magicka
  # Helper module to be used on rails
  module Helper
    autoload :ClassMethods,  'magicka/helper/class_methods'
    autoload :MethodBuilder, 'magicka/helper/method_builder'

    class << self
      include Helper::ClassMethods
    end

    with Form
    with Display

    # @method self.with(aggregator_class, type = aggregator_class.type)
    #
    # Adds a helper method magicka_+type+
    #
    # The created method executes a block with a an aggragator
    #
    # @param aggregator_class [Class<Magicka::Aggregator>]
    #   Agragator to be initialized
    # @param type [String,Symbol] type of aggregator,
    #   this will define the method name
    #
    # @return [Array<NilClass>]

    # @method magicka_form(model)
    #
    # Execute a block with an aggregator focused on a model
    #
    # The aggregator renders elements as form elements
    #
    # @param model [String] Model to be processed
    #
    # @yield [Magicka::Form] Agregator to edit a model
    #
    # @see Magicka::Form
    #
    # @return [String]

    # @method magicka_display(model)
    #
    # Execute a block with an aggregator focused on a model
    #
    # The aggregator renders elements as display elements
    #
    # @param model [String] Model to be processed
    #
    # @yield [Magicka::Display] Agregator to show a model
    #
    # @see Magicka::Display
    #
    # @return [String]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
magicka-1.0.0 lib/magicka/helper.rb
magicka-0.6.0 lib/magicka/helper.rb