class Riddl::Utils::Notifications::Producer::Backend::Sub
Public Class Methods
Source
# File lib/ruby/riddl/utils/notifications_producer.rb, line 59 def initialize(name) @name = name end
Public Instance Methods
Source
# File lib/ruby/riddl/utils/notifications_producer.rb, line 68 def delete FileUtils::rm_rf(File.dirname(@name)) end
Source
# File lib/ruby/riddl/utils/notifications_producer.rb, line 62 def modify(&block) XML::Smart.modify(@name,"<subscription xmlns='http://riddl.org/ns/common-patterns/notifications-producer/1.0'/>") do |doc| doc.register_namespace 'n', 'http://riddl.org/ns/common-patterns/notifications-producer/1.0' block.call doc end end
Source
# File lib/ruby/riddl/utils/notifications_producer.rb, line 74 def read(&block) XML::Smart.open_unprotected(@name) do |doc| doc.register_namespace 'n', 'http://riddl.org/ns/common-patterns/notifications-producer/1.0' block.call doc end end
Source
# File lib/ruby/riddl/utils/notifications_producer.rb, line 71 def to_s File.read(@name) end