Class: DeployGate::Xcode::MemberCenters::Device
- Inherits:
-
Object
- Object
- DeployGate::Xcode::MemberCenters::Device
- Defined in:
- lib/deploygate/xcode/member_centers/device.rb
Constant Summary collapse
- REGISTER_NAME_MAX_LENGTH =
50
Instance Attribute Summary collapse
-
#device_name ⇒ Object
readonly
Returns the value of attribute device_name.
-
#member_center ⇒ Object
readonly
Returns the value of attribute member_center.
-
#register_name ⇒ Object
Returns the value of attribute register_name.
-
#udid ⇒ Object
readonly
Returns the value of attribute udid.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
Instance Method Summary collapse
- #initialize(udid, user_name, device_name, member_center) ⇒ DeployGate::Devices::Ios constructor
- #register! ⇒ void
- #registered? ⇒ Boolean
- #to_s ⇒ String
Constructor Details
#initialize(udid, user_name, device_name, member_center) ⇒ DeployGate::Devices::Ios
15 16 17 18 19 20 21 22 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 15 def initialize(udid, user_name, device_name, member_center) @udid = udid @user_name = user_name @device_name = device_name @member_center = member_center @register_name = generate_register_name(@user_name, @device_name) end |
Instance Attribute Details
#device_name ⇒ Object (readonly)
Returns the value of attribute device_name.
5 6 7 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 5 def device_name @device_name end |
#member_center ⇒ Object (readonly)
Returns the value of attribute member_center.
5 6 7 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 5 def member_center @member_center end |
#register_name ⇒ Object
Returns the value of attribute register_name.
6 7 8 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 6 def register_name @register_name end |
#udid ⇒ Object (readonly)
Returns the value of attribute udid.
5 6 7 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 5 def udid @udid end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
5 6 7 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 5 def user_name @user_name end |
Instance Method Details
#register! ⇒ void
This method returns an undefined value.
29 30 31 32 33 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 29 def register! return if registered? @member_center.launcher.device.create!(name: @register_name, udid: @udid) end |
#registered? ⇒ Boolean
24 25 26 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 24 def registered? !@member_center.launcher.device.find_by_udid(@udid).nil? end |
#to_s ⇒ String
36 37 38 |
# File 'lib/deploygate/xcode/member_centers/device.rb', line 36 def to_s "Name: #{self.register_name}, UDID: #{self.udid}" end |