Class: Kaede::DBus::Program
- Inherits:
-
DBus::Object
- Object
- DBus::Object
- Kaede::DBus::Program
- Includes:
- Properties
- Defined in:
- lib/kaede/dbus/program.rb
Constant Summary collapse
- PATH =
'/cc/wanko/kaede1/program'
- PROPERTY_INTERFACE =
'org.freedesktop.DBus.Properties'
- INTROSPECT_INTERFACE =
'org.freedesktop.DBus.Introspectable'
- PROGRAM_INTERFACE =
'cc.wanko.kaede1.Program'
Instance Method Summary collapse
-
#initialize(program, enqueued_at) ⇒ Program
constructor
A new instance of Program.
- #properties ⇒ Object
- #to_xml ⇒ Object
Methods included from Properties
#get_properties, #get_property, included, #raise_access_denied!, #raise_unknown_interface!, #raise_unknown_property!, #xml_for_dbus_properties, #xml_for_properties
Constructor Details
Instance Method Details
#properties ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/kaede/dbus/program.rb', line 46 def properties @properties ||= { 'Pid' => @program.pid, 'Tid' => @program.tid, 'StartTime' => @program.start_time.iso8601, 'EndTime' => @program.end_time.iso8601, 'ChannelName' => @program.channel_name, 'ChannelForSyoboi' => @program.channel_for_syoboi, 'ChannelForRecorder' => @program.channel_for_recorder, 'Count' => @program.count, 'StartOffset' => @program.start_offset, 'SubTitle' => @program.subtitle, 'Title' => @program.title, 'Comment' => @program.comment, 'EnqueuedAt' => @enqueued_at.iso8601, } end |
#to_xml ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/kaede/dbus/program.rb', line 24 def to_xml Nokogiri::XML::Builder.new do |xml| xml.doc.create_internal_subset( 'node', '-//freedesktop//DTD D-BUS Object Introspection 1.0//EN', 'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd', ) xml.node do xml.interface(name: INTROSPECT_INTERFACE) do xml.method_(name: 'Introspect') do xml.arg(name: 'data', direction: 'out', type: 's') end end xml_for_properties(xml) end end.to_xml end |