Class: Fastlane::ActionCommand

Inherits:
Object
  • Object
show all
Defined in:
fastlane/lib/fastlane/server/action_command.rb

Overview

Represents a command that is meant to execute an Action on the client’s behalf

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json: nil) ⇒ ActionCommand

Returns a new instance of ActionCommand.



34
35
36
37
38
39
40
41
42
43
# File 'fastlane/lib/fastlane/server/action_command.rb', line 34

def initialize(json: nil)
  @method_name = json['methodName']
  @class_name = json['className']
  @command_id = json['commandID']

  args_json = json['args'] ||= []
  @args = args_json.map do |arg|
    Argument.new(json: arg)
  end
end

Instance Attribute Details

#argsObject (readonly)

always present



30
31
32
# File 'fastlane/lib/fastlane/server/action_command.rb', line 30

def args
  @args
end

#class_nameObject (readonly)

only present when executing a class-method



32
33
34
# File 'fastlane/lib/fastlane/server/action_command.rb', line 32

def class_name
  @class_name
end

#command_idObject (readonly)

always present



29
30
31
# File 'fastlane/lib/fastlane/server/action_command.rb', line 29

def command_id
  @command_id
end

#method_nameObject (readonly)

always present



31
32
33
# File 'fastlane/lib/fastlane/server/action_command.rb', line 31

def method_name
  @method_name
end

Instance Method Details

#cancel_signal?Boolean

Returns:



45
46
47
# File 'fastlane/lib/fastlane/server/action_command.rb', line 45

def cancel_signal?
  return @command_id == "cancelFastlaneRun"
end

#is_class_method_commandObject



57
58
59
# File 'fastlane/lib/fastlane/server/action_command.rb', line 57

def is_class_method_command
  return class_name.to_s.length > 0
end

#target_classObject



49
50
51
52
53
54
55
# File 'fastlane/lib/fastlane/server/action_command.rb', line 49

def target_class
  unless class_name
    return nil
  end

  return Fastlane::Actions.const_get(class_name)
end