Module: Titi::Provider::ActivityStreams::Common
- Defined in:
- lib/titi/provider/activity_streams.rb
Overview
Some methods common to all ActivityStreams classes
Instance Method Summary collapse
Instance Method Details
#to_hash(*args) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/titi/provider/activity_streams.rb', line 8 def to_hash *args hsh = super(*args) hsh.each do |attr, val| hsh[attr] = val.to_hash if val.respond_to?(:to_hash) end hsh end |
#to_xml(*args) ⇒ Object
16 17 18 19 |
# File 'lib/titi/provider/activity_streams.rb', line 16 def to_xml *args hsh = self.to_hash hsh.to_xml :root => self.class.to_s.underscore.gsub(%r{.*/},'') end |