Class: Fastlane::Lane

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

Overview

Represents a lane

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platform: nil, name: nil, description: nil, block: nil, is_private: false) ⇒ Lane

Returns a new instance of Lane.



17
18
19
20
21
22
23
24
25
# File 'lib/fastlane/lane.rb', line 17

def initialize(platform: nil, name: nil, description: nil, block: nil, is_private: false)
  raise "description must be an array" unless description.kind_of?Array
  
  self.platform = platform
  self.name = name
  self.description = description
  self.block = block
  self.is_private = is_private
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



12
13
14
# File 'lib/fastlane/lane.rb', line 12

def block
  @block
end

#descriptionArray

Returns An array containing the description of this lane Each item of the array is one line.

Returns:

  • (Array)

    An array containing the description of this lane Each item of the array is one line



10
11
12
# File 'lib/fastlane/lane.rb', line 10

def description
  @description
end

#is_privateBoolean

Returns Is that a private lane that can’t be called from the CLI?.

Returns:

  • (Boolean)

    Is that a private lane that can’t be called from the CLI?



15
16
17
# File 'lib/fastlane/lane.rb', line 15

def is_private
  @is_private
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/fastlane/lane.rb', line 6

def name
  @name
end

#platformObject

Returns the value of attribute platform.



4
5
6
# File 'lib/fastlane/lane.rb', line 4

def platform
  @platform
end

Instance Method Details

#call(parameters) ⇒ Object

Execute this lane



28
29
30
# File 'lib/fastlane/lane.rb', line 28

def call(parameters)
  block.call(parameters || {})
end

#pretty_nameString

Returns The lane + name of the lane. If there is no platform, it will only be the lane name.

Returns:

  • (String)

    The lane + name of the lane. If there is no platform, it will only be the lane name



33
34
35
# File 'lib/fastlane/lane.rb', line 33

def pretty_name
  [platform, name].reject(&:nil?).join(' ')
end