Class: TinyAppstoreConnect::Model::Device

Inherits:
Object
  • Object
show all
Includes:
TinyAppstoreConnect::Model
Defined in:
lib/tiny_appstore_connect/models/device.rb

Defined Under Namespace

Modules: DeviceClass, Status

Instance Attribute Summary collapse

Attributes included from TinyAppstoreConnect::Model

#id, #included, #rate

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TinyAppstoreConnect::Model

included, #initialize, #update_attributes, #update_include

Instance Attribute Details

#added_dateObject

Returns the value of attribute added_date.



16
17
18
# File 'lib/tiny_appstore_connect/models/device.rb', line 16

def added_date
  @added_date
end

#appObject

include



38
39
40
# File 'lib/tiny_appstore_connect/models/device.rb', line 38

def app
  @app
end

#buildObject

attr_accessor :app_store_version_submission



40
41
42
# File 'lib/tiny_appstore_connect/models/device.rb', line 40

def build
  @build
end

#device_classObject

Returns the value of attribute device_class.



10
11
12
# File 'lib/tiny_appstore_connect/models/device.rb', line 10

def device_class
  @device_class
end

#modelObject

Returns the value of attribute model.



11
12
13
# File 'lib/tiny_appstore_connect/models/device.rb', line 11

def model
  @model
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/tiny_appstore_connect/models/device.rb', line 12

def name
  @name
end

#platformObject

Returns the value of attribute platform.



13
14
15
# File 'lib/tiny_appstore_connect/models/device.rb', line 13

def platform
  @platform
end

#statusObject

Returns the value of attribute status.



14
15
16
# File 'lib/tiny_appstore_connect/models/device.rb', line 14

def status
  @status
end

#udidObject

Returns the value of attribute udid.



15
16
17
# File 'lib/tiny_appstore_connect/models/device.rb', line 15

def udid
  @udid
end

Class Method Details

.typeObject



56
57
58
# File 'lib/tiny_appstore_connect/models/device.rb', line 56

def self.type
  return 'devices'
end

Instance Method Details

#deviceObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/tiny_appstore_connect/models/device.rb', line 18

def device
  return model unless model.nil?

  case device_class
  when DeviceClass::APPLE_WATCH
    'Apple Watch'
  when DeviceClass::IPAD
    'iPad'
  when DeviceClass::IPHONE
    'iPhone'
  when DeviceClass::IPOD
    'iPod Touch'
  when DeviceClass::APPLE_TV
    'Apple TV'
  when DeviceClass::MAC
    'macOS'
  end
end

#enabled?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/tiny_appstore_connect/models/device.rb', line 60

def enabled?
  return status == Status::ENABLED
end