Class: PushBot::Platform
- Inherits:
-
Object
- Object
- PushBot::Platform
- Defined in:
- lib/push_bot/platform.rb
Constant Summary collapse
- VALUES =
%w(ios android)
Class Method Summary collapse
-
.parse(*platforms) ⇒ Object
Translate an array of :ios / :android into an array of integer strings.
Class Method Details
.parse(*platforms) ⇒ Object
Translate an array of :ios / :android into an array of integer strings
9 10 11 12 13 14 |
# File 'lib/push_bot/platform.rb', line 9 def self.parse(*platforms) platforms = platforms.flatten.map! {|p| VALUES.index(p.to_s.downcase) } raise(ArgumentError, 'Platform must be ios or android') if platforms.any?(&:nil?) platforms.map!(&:to_s) end |