Class: TripAdvisor::TestDevice
- Inherits:
-
Object
- Object
- TripAdvisor::TestDevice
- Defined in:
- lib/trip_advisor/rake_tasks.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#valid_schemes ⇒ Object
Returns the value of attribute valid_schemes.
Instance Method Summary collapse
- #destination_arg(os_version) ⇒ Object
- #eql?(object) ⇒ Boolean
- #hash ⇒ Object
-
#initialize ⇒ TestDevice
constructor
A new instance of TestDevice.
- #sdk ⇒ Object
- #short_name ⇒ Object
- #to_s ⇒ Object
- #valid_for?(scheme_name) ⇒ Boolean
Constructor Details
#initialize ⇒ TestDevice
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
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/trip_advisor/rake_tasks.rb', line 6 def name @name end |
#platform ⇒ Object
Returns the value of attribute platform.
6 7 8 |
# File 'lib/trip_advisor/rake_tasks.rb', line 6 def platform @platform end |
#valid_schemes ⇒ Object
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
38 39 40 |
# File 'lib/trip_advisor/rake_tasks.rb', line 38 def eql?(object) platform.eql?(object.platform) && name.eql?(object.name) end |
#hash ⇒ Object
34 35 36 |
# File 'lib/trip_advisor/rake_tasks.rb', line 34 def hash [platform, name].hash end |
#sdk ⇒ Object
22 23 24 |
# File 'lib/trip_advisor/rake_tasks.rb', line 22 def sdk platform.eql?('iOS Simulator') ? 'iphonesimulator' : 'iphoneos' end |
#short_name ⇒ Object
26 27 28 |
# File 'lib/trip_advisor/rake_tasks.rb', line 26 def short_name "#{name.downcase.gsub(/\s+/, '')}" end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/trip_advisor/rake_tasks.rb', line 30 def to_s "#{name} (#{platform})" end |
#valid_for?(scheme_name) ⇒ 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 |