Module: ComponentHelper

Defined in:
lib/komponent/core/component_helper.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#propertiesObject

Returns the value of attribute properties.



8
9
10
# File 'lib/komponent/core/component_helper.rb', line 8

def properties
  @properties
end

Class Method Details

.extended(component) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/komponent/core/component_helper.rb', line 10

def self.extended(component)
  component.properties = {}
  component.class_eval do
    def block_given_to_component?
      @block_given_to_component.present?
    end
  end
end

Instance Method Details

#property(name, options = {}) ⇒ Object



4
5
6
# File 'lib/komponent/core/component_helper.rb', line 4

def property(name, options = {})
  @properties[name] = options
end