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.
455 456 457 458 459 460 461 462 463 |
# File 'lib/configuration.rb', line 455 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.
453 454 455 |
# File 'lib/configuration.rb', line 453 def name @name end |
Instance Method Details
#engine ⇒ Object
465 466 467 |
# File 'lib/configuration.rb', line 465 def engine namespace::Engine end |
#namespace ⇒ Object
473 474 475 |
# File 'lib/configuration.rb', line 473 def namespace @namespace ||= "houston/#{name}".camelize.constantize end |
#path ⇒ Object
469 470 471 |
# File 'lib/configuration.rb', line 469 def path "/#{name}" end |