Class: Producer::Core::Action

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/producer/core/action.rb

Constant Summary collapse

INSPECT_ARGUMENTS_SUM_LEN =
68.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, *args, **options) ⇒ Action

Returns a new instance of Action.



12
13
14
15
16
17
# File 'lib/producer/core/action.rb', line 12

def initialize(env, *args, **options)
  @env        = env
  @arguments  = args
  @options    = options
  setup if respond_to? :setup
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



10
11
12
# File 'lib/producer/core/action.rb', line 10

def arguments
  @arguments
end

#envObject (readonly)

Returns the value of attribute env.



10
11
12
# File 'lib/producer/core/action.rb', line 10

def env
  @env
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/producer/core/action.rb', line 10

def options
  @options
end

Instance Method Details

#nameObject



19
20
21
# File 'lib/producer/core/action.rb', line 19

def name
  self.class.name.split('::').last.downcase
end

#to_sObject



23
24
25
# File 'lib/producer/core/action.rb', line 23

def to_s
  [name, inspect_arguments].join ' '
end