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) ⇒ Lane

Returns a new instance of Lane.



14
15
16
17
18
19
20
21
# File 'lib/fastlane/lane.rb', line 14

def initialize(platform: nil, name: nil, description: nil, block: nil)
  raise "description must be an array" unless description.kind_of?Array
  
  self.platform = platform
  self.name = name
  self.description = description
  self.block = block
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

#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



24
25
26
# File 'lib/fastlane/lane.rb', line 24

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



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

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