Class: Houston::Module

Inherits:
Object
  • Object
show all
Defined in:
lib/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options={}, &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

#nameObject (readonly)

Returns the value of attribute name.



453
454
455
# File 'lib/configuration.rb', line 453

def name
  @name
end

Instance Method Details

#engineObject



465
466
467
# File 'lib/configuration.rb', line 465

def engine
  namespace::Engine
end

#namespaceObject



473
474
475
# File 'lib/configuration.rb', line 473

def namespace
  @namespace ||= "houston/#{name}".camelize.constantize
end

#pathObject



469
470
471
# File 'lib/configuration.rb', line 469

def path
  "/#{name}"
end