Class: Houston::Module
- Inherits:
-
Object
- Object
- Houston::Module
- Defined in:
- lib/configuration.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #engine ⇒ Object
-
#initialize(module_name, options = {}, &moduleconfig) ⇒ Module
constructor
A new instance of Module.
- #namespace ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(module_name, options = {}, &moduleconfig) ⇒ Module
Returns a new instance of Module.
454 455 456 457 458 459 460 461 462 |
# File 'lib/configuration.rb', line 454 def initialize(module_name, ={}, &moduleconfig) @name = module_name.to_s if namespace.respond_to?(:config) && block_given? namespace.config(&moduleconfig) elsif block_given? && !namespace.respond_to?(:config) raise "#{name} does not accept configuration" end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
452 453 454 |
# File 'lib/configuration.rb', line 452 def name @name end |
Instance Method Details
#engine ⇒ Object
464 465 466 |
# File 'lib/configuration.rb', line 464 def engine namespace::Engine end |
#namespace ⇒ Object
472 473 474 |
# File 'lib/configuration.rb', line 472 def namespace @namespace ||= "houston/#{name}".camelize.constantize end |
#path ⇒ Object
468 469 470 |
# File 'lib/configuration.rb', line 468 def path "/#{name}" end |