Class: Airplay::Device::Info
- Inherits:
-
Object
- Object
- Airplay::Device::Info
- Defined in:
- lib/airplay/device/info.rb
Overview
Public: Simple class to represent information of a Device
Instance Attribute Summary collapse
-
#mac_address ⇒ Object
readonly
Returns the value of attribute mac_address.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#os_version ⇒ Object
readonly
Returns the value of attribute os_version.
Instance Method Summary collapse
-
#initialize(device) ⇒ Info
constructor
A new instance of Info.
- #resolution ⇒ Object
Constructor Details
#initialize(device) ⇒ Info
Returns a new instance of Info.
10 11 12 13 14 15 |
# File 'lib/airplay/device/info.rb', line 10 def initialize(device) @device = device @model = device.server_info["model"] @os_version = device.server_info["srcvers"] @mac_address = device.server_info["macAddress"] end |
Instance Attribute Details
#mac_address ⇒ Object (readonly)
Returns the value of attribute mac_address.
8 9 10 |
# File 'lib/airplay/device/info.rb', line 8 def mac_address @mac_address end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
8 9 10 |
# File 'lib/airplay/device/info.rb', line 8 def model @model end |
#os_version ⇒ Object (readonly)
Returns the value of attribute os_version.
8 9 10 |
# File 'lib/airplay/device/info.rb', line 8 def os_version @os_version end |
Instance Method Details
#resolution ⇒ Object
17 18 19 20 21 |
# File 'lib/airplay/device/info.rb', line 17 def resolution @_resolution ||= begin "#{@device.server_info["width"]}x#{@device.server_info["height"]}" end end |