Ios ::设备
这是一个小宝石,用于将Apple iOS设备类型(例如“ iPhone6,1”)转换为可以使用的正确设备名称。
安装
将此行添加到您的应用程序的Gemfile中:
gem 'ios-devices'
然后执行:
$ bundle
或将其自己安装为:
$ gem install ios-devices
用法
只需将Ios::Devices.search方法与Apple字符串一起使用,您将获得一个Ios::Devices::Model对象。 该对象具有诸如互联网连接,修订模型等之类的extra属性。
device = Ios :: Devices . search ( 'iPhone6,1' )
=> #<Ios::Devices::Model:0x007fa55ba1a948 @extra=nil, @name="iPhone 5s", @devic