Class: SonyCameraRemote::Discovery::ServicesMapper
- Inherits:
-
Object
- Object
- SonyCameraRemote::Discovery::ServicesMapper
- Defined in:
- lib/sony_camera_remote/discovery/device_info.rb
Class Method Summary collapse
Class Method Details
.map(services_info) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sony_camera_remote/discovery/device_info.rb', line 22 def map(services_info) services_info['service'].map do |service| # urn:upnp-org:serviceId:ContentDirectory => ContentDirectory # urn:upnp-org:serviceId:ConnectionManager => ConnectionManager # urn:schemas-sony-com:serviceId:ScalarWebAPI => ScalarWebAPI service_class = "#{service['serviceId'].split(':').last}Service" SonyCameraRemote::Services.const_get(service_class).new.tap do |s| s.id = service['serviceId'] s.type = service['serviceType'] s.scpd_url = service['SCPDURL'] s.control_url = service['controlURL'] s.event_sub_url = service['eventSubURL'] end end end |