Module: WrapIt::DerivedAttributes

Extended by:
ClassMethods
Included in:
Arguments, Base, Callbacks, Enums, HTML, Sections, Switches
Defined in:
lib/wrap_it/derived_attributes.rb

Overview

Adds minimal support to retrieve derived class variables

Author:

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.collect_derived(name, result = [], method = :concat) ⇒ Object Originally defined in module ClassMethods

Collects all derived variables with specified name

Parameters:

  • name (Symbol)

    variable name (should contain @ sign)

  • initial (Object)

    initial collection object

  • method (Symbol) (defaults to: :concat)

    collection's method name to concatinate founded variable with collection

Returns:

  • (Object)

    collection of variables

.get_derived(name) ⇒ Object? Originally defined in module ClassMethods

retrieves first founded derived variable or nil

Parameters:

  • name (Symbol)

    variable name (should contain @ sign)

Returns:

  • (Object, nil)

    founded variable or nil

.parentsObject Originally defined in module ClassMethods