Class: OpenComponents::Component
- Inherits:
-
Object
- Object
- OpenComponents::Component
- Defined in:
- lib/opencomponents/component.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#registry_version ⇒ Object
readonly
Returns the value of attribute registry_version.
-
#render_mode ⇒ Object
readonly
Returns the value of attribute render_mode.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #flush! ⇒ Object
-
#initialize(name, params = {}, version = '') ⇒ Component
constructor
A new instance of Component.
- #reload! ⇒ Object
- #request_version ⇒ Object
Constructor Details
#initialize(name, params = {}, version = '') ⇒ Component
Returns a new instance of Component.
8 9 10 11 12 |
# File 'lib/opencomponents/component.rb', line 8 def initialize(name, params = {}, version = '') @name = name @params = params @version = version end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def href @href end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def params @params end |
#registry_version ⇒ Object (readonly)
Returns the value of attribute registry_version.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def registry_version @registry_version end |
#render_mode ⇒ Object (readonly)
Returns the value of attribute render_mode.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def render_mode @render_mode end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/opencomponents/component.rb', line 5 def version @version end |
Instance Method Details
#flush! ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/opencomponents/component.rb', line 18 def flush! flush_variables_whitelist.each do |var| instance_variable_set(var, nil) end self end |
#reload! ⇒ Object
26 27 28 29 |
# File 'lib/opencomponents/component.rb', line 26 def reload! flush! load end |
#request_version ⇒ Object
14 15 16 |
# File 'lib/opencomponents/component.rb', line 14 def request_version @request_version == '' ? nil : @request_version end |