Class: Airplay::Device::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/airplay/device/info.rb

Overview

Public: Simple class to represent information of a Device

Instance Attribute Summary collapse

Instance Method Summary collapse

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_addressObject (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

#modelObject (readonly)

Returns the value of attribute model.



8
9
10
# File 'lib/airplay/device/info.rb', line 8

def model
  @model
end

#os_versionObject (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

#resolutionObject



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