module Airplay
Public: Airplay
core module
Public: Airplay
core module
Public: Airplay
core module
Constants
- VERSION
Public Class Methods
Public: Access a device by name
device_name - The name to search on the devices
Returns the found device
# File lib/airplay.rb, line 80 def [](device_name) devices.find_by_name(device_name) end
Public: Helper method to access all the devices
Returns a Group
with all the devices.
# File lib/airplay.rb, line 49 def all @_all ||= begin group = Group.new(:all) devices.each { |device| group << device } group end end
Public: Browses for devices in the current network
Returns nothing.
# File lib/airplay.rb, line 33 def browse browser.browse end
Public: Access the configuration object
Returns the Configuration
object
# File lib/airplay.rb, line 70 def configuration @_configuration ||= Configuration.new end
Public: General configuration
&block - The block that will modify the configuration
Returns the configuration file.
# File lib/airplay.rb, line 17 def configure(&block) yield(configuration) if block end
Public: Lists found devices if autodiscover is enabled
Returns an Array with all the devices
# File lib/airplay.rb, line 61 def devices browse if browser.devices.empty? && configuration.autodiscover browser.devices end
Public: Access or create a group based on a key
Returns the Hash object.
# File lib/airplay.rb, line 41 def group @_group ||= Hash.new { |h, k| h[k] = Group.new(k) } end
Public: Access the server object
Returns the Server
object
# File lib/airplay.rb, line 25 def server @_server ||= Server.new end
Private Class Methods
Private: Access the browser object
Returns the momoized Browser
object
# File lib/airplay.rb, line 90 def browser @_browser ||= Browser.new end