Module: OpenComponents
- Defined in:
- lib/opencomponents.rb,
lib/opencomponents/version.rb,
lib/opencomponents/renderer.rb,
lib/opencomponents/component.rb,
lib/opencomponents/rendered_component.rb,
lib/opencomponents/prerendered_component.rb
Defined Under Namespace
Modules: Renderer Classes: Component, Configuration, PrerenderedComponent, RenderedComponent, Template
Constant Summary collapse
- DEFAULT_REGISTRY =
Public: Default OC registry URL (localhost:3030).
'http://localhost:3030'
- DEFAULT_TIMEOUT =
Public: Default request timeout in seconds (5)
5
- ComponentNotFound =
Internal: Custom exception class to raise in the event a component cannot be
found in the registry.
Class.new(RuntimeError)
- RegistryTimeout =
Internal: Custom exception class to raise for response timeouts.
Class.new(RuntimeError)
- VERSION =
:nodoc:
'0.4.0'
Class Method Summary collapse
-
.config ⇒ Object
Public: Getter for OC Configuration.
-
.configure {|self.config| ... } ⇒ Object
Public: Setter for Configuration.
Class Method Details
.config ⇒ Object
Public: Getter for OC Configuration.
Returns the Configuration if set, a default Configuration if not set.
38 39 40 |
# File 'lib/opencomponents.rb', line 38 def self.config @@_config ||= Configuration.new(DEFAULT_REGISTRY, DEFAULT_TIMEOUT) end |
.configure {|self.config| ... } ⇒ Object
Public: Setter for Configuration.
Examples
OpenComponents.configure do |oc|
oc.registry = 'http://my-awesome-oc-registry.com'
end
Returns the Configuration.
51 52 53 |
# File 'lib/opencomponents.rb', line 51 def self.configure yield self.config end |