Class: Palmade::Cableguy::CableConfigurator

Inherits:
Configurator show all
Defined in:
lib/palmade/cableguy/cable_configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Configurator

#append_args, #call_section, configure, #configure, #include?, #method_missing

Constructor Details

#initialize(*args) ⇒ CableConfigurator

Returns a new instance of CableConfigurator.



6
7
8
9
# File 'lib/palmade/cableguy/cable_configurator.rb', line 6

def initialize(*args)
  super
  @setups = [ ]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Palmade::Cableguy::Configurator

Instance Attribute Details

#requiresObject (readonly)

Returns the value of attribute requires.



4
5
6
# File 'lib/palmade/cableguy/cable_configurator.rb', line 4

def requires
  @requires
end

#setupsObject (readonly)

Returns the value of attribute setups.



3
4
5
# File 'lib/palmade/cableguy/cable_configurator.rb', line 3

def setups
  @setups
end

Instance Method Details

#requirements(*args, &block) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/palmade/cableguy/cable_configurator.rb', line 19

def requirements(*args, &block)
  if block_given?
    update_section(:requirements, *args, &block)
  else
    call_section(:requirements, *args)
  end
end

#setup(what, *args, &block) ⇒ Object



27
28
29
# File 'lib/palmade/cableguy/cable_configurator.rb', line 27

def setup(what, *args, &block)
  @setups.push([ what, args, block ])
end

#setup_cabling(*args, &block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/palmade/cableguy/cable_configurator.rb', line 11

def setup_cabling(*args, &block)
  if block_given?
    update_section(:setup_cabling, *args, &block)
  else
    call_section(:setup_cabling, *args)
  end
end