Class: Lotus::Atom::Generator

Inherits:
Atom::Generator
  • Object
show all
Defined in:
lib/lotus/atom/generator.rb

Overview

This class represents an OStatus Generator object.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_canonical(obj) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lotus/atom/generator.rb', line 16

def self.from_canonical(obj)
  hash = obj.to_hash
  if hash[:base]
    hash[:xml_base] = hash[:base]
  end
  if hash[:lang]
    hash[:xml_lang] = hash[:lang]
  end
  hash.delete :base
  hash.delete :lang
  self.new(hash)
end

Instance Method Details

#to_canonicalObject



29
30
31
32
33
34
35
# File 'lib/lotus/atom/generator.rb', line 29

def to_canonical
  Lotus::Generator.new(:base    => self.xml_base,
                       :lang    => self.xml_lang,
                       :version => self.version,
                       :name    => self.name,
                       :uri     => self.uri)
end