Class: VieraPlay::Soapy

Inherits:
Object
  • Object
show all
Defined in:
lib/viera_play/soapy.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Soapy

Returns a new instance of Soapy.



6
7
8
9
10
# File 'lib/viera_play/soapy.rb', line 6

def initialize(opts={})
  @endpoint = URI.parse(opts.fetch(:endpoint))
  @namespace = opts.fetch(:namespace)
  @default_request_args = opts.fetch(:default_request_args, {})
end

Instance Method Details

#send_command(command, args = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/viera_play/soapy.rb', line 12

def send_command(command, args={})
  post(
    {
      "SOAPACTION" => %Q{"#{namespace}##{command}"},
      "Content-type" => "text/xml"
    },
    soap_body(command, default_request_args.merge(args))
  )
end