Module: SmartCore::Initializer::InstanceAttributeAccessing Private

Defined in:
lib/smart_core/initializer/instance_attribute_accessing.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.5.0

Instance Method Summary collapse

Instance Method Details

#__collect_options__Hash<Symbol,Any>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.5.0



44
45
46
47
48
# File 'lib/smart_core/initializer/instance_attribute_accessing.rb', line 44

def __collect_options__
  self.class.__options__.each_with_object({}) do |option, memo|
    memo[option.name] = instance_variable_get("@#{option.name}")
  end
end

#__collect_params__Hash<Symbol,Any>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.5.0



34
35
36
37
38
# File 'lib/smart_core/initializer/instance_attribute_accessing.rb', line 34

def __collect_params__
  self.class.__params__.each_with_object({}) do |param, memo|
    memo[param.name] = instance_variable_get("@#{param.name}")
  end
end

#attributesHash<Symbol,Any>

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.5.0



26
27
28
# File 'lib/smart_core/initializer/instance_attribute_accessing.rb', line 26

def attributes
  __collect_params__.merge(__collect_options__)
end

#optionsHash<Symbol,Any>

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.5.0



18
19
20
# File 'lib/smart_core/initializer/instance_attribute_accessing.rb', line 18

def options
  __collect_options__
end

#paramsHash<Symbol,Any>

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.5.0



10
11
12
# File 'lib/smart_core/initializer/instance_attribute_accessing.rb', line 10

def params
  __collect_params__
end