Class: RubyRest::Atom::Entry::Document
- Inherits:
-
REXML::Document
- Object
- REXML::Document
- RubyRest::Atom::Entry::Document
- Defined in:
- lib/rubyrest/atom.rb
Overview
Adds some convenience methods to a standard REXML document. This class supposes that the document is an Atom entry
Instance Method Summary collapse
-
#clone ⇒ Object
Overrides the default implementation by returning a new Ruby-on-Rest Atom Document.
-
#id ⇒ Object
Shortcut for the id element contained within the content.
-
#method_missing(name, *args) ⇒ Object
Resolves the missing method into a content property and returns its text value.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
permalink #method_missing(name, *args) ⇒ Object
Resolves the missing method into a content property and returns its text value
164 165 166 167 168 169 170 |
# File 'lib/rubyrest/atom.rb', line 164 def method_missing( name, *args ) location = "/entry/moodisland:content/#{name}" method_name = name.to_s.chomp if method_name == name.to_s text( location ) else get_text( location ).value = args[0] end end |
Instance Method Details
permalink #clone ⇒ Object
Overrides the default implementation by returning a new Ruby-on-Rest Atom Document
180 181 182 |
# File 'lib/rubyrest/atom.rb', line 180 def clone self.class.new self.to_s end |
permalink #id ⇒ Object
Shortcut for the id element contained within the content.
174 175 176 |
# File 'lib/rubyrest/atom.rb', line 174 def id text( "/entry/moodisland:content/id" ) end |