Class: Pug::Action::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/pug/action/input.rb

Overview

Defines input requirements for an Action

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name, required) ⇒ Input

Returns a new instance of Input.

Parameters:

  • action_name (String)

    The name of the Action

  • required (Boolean)

    if Action requires input



15
16
17
18
# File 'lib/pug/action/input.rb', line 15

def initialize(action_name, required)
  @action_name = action_name
  @required = required
end

Instance Attribute Details

#action_nameString

Returns the name of the Action.

Returns:

  • (String)

    the name of the Action



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pug/action/input.rb', line 10

class Input
  attr_reader :action_name, :required

  # @param action_name [String] The name of the Action
  # @param required [Boolean] if Action requires input
  def initialize(action_name, required)
    @action_name = action_name
    @required = required
  end

  # @return [Boolean] if Action requires input
  def required?
    @required
  end
end

#requiredBoolean

Returns if Action requires input.

Returns:

  • (Boolean)

    if Action requires input



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pug/action/input.rb', line 10

class Input
  attr_reader :action_name, :required

  # @param action_name [String] The name of the Action
  # @param required [Boolean] if Action requires input
  def initialize(action_name, required)
    @action_name = action_name
    @required = required
  end

  # @return [Boolean] if Action requires input
  def required?
    @required
  end
end

Instance Method Details

#required?Boolean

Returns if Action requires input.

Returns:

  • (Boolean)

    if Action requires input



21
22
23
# File 'lib/pug/action/input.rb', line 21

def required?
  @required
end