class Opera::MobileStore::DevicePlatform
Constants
- ANDROID_SDK_LEVEL_VERSION_CODES
- OPERA_PLATFORM_TO_ANDROID_SDK_MAPPINGS
Attributes
code[RW]
All attributes are Read-Only…
id[RW]
All attributes are Read-Only…
name[RW]
All attributes are Read-Only…
Public Class Methods
build_from_nokogiri_node(node)
click to toggle source
# File lib/opera/mobile_store/device_platform.rb, line 84 def self.build_from_nokogiri_node(node) data = { id: node.xpath("number(@id)").to_i, code: node.xpath("string(@code)").strip, name: node.text.strip }.select { |key, val| val.present? } self.new data end
Public Instance Methods
android_sdk_level()
click to toggle source
# File lib/opera/mobile_store/device_platform.rb, line 74 def android_sdk_level OPERA_PLATFORM_TO_ANDROID_SDK_MAPPINGS[code] if code['platform-android'].present? end
android_version_code()
click to toggle source
# File lib/opera/mobile_store/device_platform.rb, line 78 def android_version_code ANDROID_SDK_LEVEL_VERSION_CODES[android_sdk_level] end
attributes()
click to toggle source
# File lib/opera/mobile_store/device_platform.rb, line 66 def attributes [:id, :code, :name].inject({}) do |hash, field_name| field_value = self.public_send field_name hash[field_name.to_s] = field_value unless field_value.nil? hash end end