Class: Peachy::SimpleContent
- Inherits:
-
Object
- Object
- Peachy::SimpleContent
- Includes:
- MorphIntoArray, MyMetaClass
- Defined in:
- lib/peachy/simple_content.rb
Instance Method Summary collapse
-
#initialize(xml) ⇒ SimpleContent
constructor
A new instance of SimpleContent.
- #method_missing(method_name, *args, &block) ⇒ Object
- #value ⇒ Object
Methods included from Compatibility
Constructor Details
#initialize(xml) ⇒ SimpleContent
Returns a new instance of SimpleContent.
7 8 9 |
# File 'lib/peachy/simple_content.rb', line 7 def initialize xml @xml = xml end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
16 17 18 19 |
# File 'lib/peachy/simple_content.rb', line 16 def method_missing method_name, *args, &block return morph_with_content(method_name, *args, &block) if used_as_array(method_name, block_given?, *args) super end |
Instance Method Details
#value ⇒ Object
11 12 13 14 |
# File 'lib/peachy/simple_content.rb', line 11 def value acts_as_only_child @xml.content end |