Module: Pntfr::Platforms

Defined in:
lib/pntfr/platforms.rb

Constant Summary collapse

ANDROID =
'ANDROID'
IOS =
'IOS'

Class Method Summary collapse

Class Method Details

.allObject

All supported platforms



14
15
16
# File 'lib/pntfr/platforms.rb', line 14

def self.all
  [ANDROID, IOS]
end

.android?(string) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/pntfr/platforms.rb', line 5

def self.android? string
  return false if string.nil? or string.empty?
  ANDROID == string.upcase
end

.given_or_default_to_all(platform) ⇒ Object

Returns a list of platforms:

  • if the platform param is present wraps it into an Array.

  • else returns all supported platforms.



21
22
23
24
25
26
27
# File 'lib/pntfr/platforms.rb', line 21

def self.given_or_default_to_all(platform)
  if platform
    [platform]
  else
    Pntfr::Platforms.all
  end
end

.ios?(string) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/pntfr/platforms.rb', line 9

def self.ios? string
  return false if string.nil? or string.empty?
  IOS == string.upcase
end