Class: TripAdvisor::TestDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/trip_advisor/rake_tasks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestDevice

Returns a new instance of TestDevice.



8
9
10
11
12
# File 'lib/trip_advisor/rake_tasks.rb', line 8

def initialize
  @platform = 'iOS Simulator'
  @name = 'iPhone 6'
  @valid_schemes = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/trip_advisor/rake_tasks.rb', line 6

def name
  @name
end

#platformObject

Returns the value of attribute platform.



6
7
8
# File 'lib/trip_advisor/rake_tasks.rb', line 6

def platform
  @platform
end

#valid_schemesObject

Returns the value of attribute valid_schemes.



6
7
8
# File 'lib/trip_advisor/rake_tasks.rb', line 6

def valid_schemes
  @valid_schemes
end

Instance Method Details

#destination_arg(os_version) ⇒ Object



14
15
16
# File 'lib/trip_advisor/rake_tasks.rb', line 14

def destination_arg(os_version)
  "platform='#{platform}',OS=#{os_version},name='#{name}'"
end

#eql?(object) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/trip_advisor/rake_tasks.rb', line 38

def eql?(object)
  platform.eql?(object.platform) && name.eql?(object.name)
end

#hashObject



34
35
36
# File 'lib/trip_advisor/rake_tasks.rb', line 34

def hash
  [platform, name].hash
end

#sdkObject



22
23
24
# File 'lib/trip_advisor/rake_tasks.rb', line 22

def sdk
  platform.eql?('iOS Simulator') ? 'iphonesimulator' : 'iphoneos'
end

#short_nameObject



26
27
28
# File 'lib/trip_advisor/rake_tasks.rb', line 26

def short_name
  "#{name.downcase.gsub(/\s+/, '')}"
end

#to_sObject



30
31
32
# File 'lib/trip_advisor/rake_tasks.rb', line 30

def to_s
  "#{name} (#{platform})"
end

#valid_for?(scheme_name) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/trip_advisor/rake_tasks.rb', line 18

def valid_for?(scheme_name)
  valid_schemes.empty? || valid_schemes.include?(scheme_name)
end