Class: Fastlane::Helper::SyncDevicesHelper::Command::EnableAndRename

Inherits:
Base
  • Object
show all
Defined in:
lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/command.rb

Overview

Command to enable and rename an existing device.

Instance Attribute Summary collapse

Attributes inherited from Base

#device

Instance Method Summary collapse

Constructor Details

#initialize(device, name) ⇒ EnableAndRename

Returns a new instance of EnableAndRename.

Parameters:

  • device (Spaceship::ConnectAPI::Device)
  • name (String)


134
135
136
137
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/command.rb', line 134

def initialize(device, name)
  super(device)
  @name = name
end

Instance Attribute Details

#nameString (readonly)

Returns name.

Returns:

  • (String)

    name



130
131
132
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/command.rb', line 130

def name
  @name
end

Instance Method Details

#descriptionString

Returns:

  • (String)


149
150
151
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/command.rb', line 149

def description
  "Enabled and renamed #{device.name} to #{name} (#{device.udid})"
end

#runvoid

This method returns an undefined value.



140
141
142
143
144
145
146
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/command.rb', line 140

def run
  Spaceship::ConnectAPI::Device.modify(
    device.udid,
    enabled: true,
    new_name: name
  )
end