Class: Peachy::SimpleContent

Inherits:
Object
  • Object
show all
Includes:
MorphIntoArray, MyMetaClass
Defined in:
lib/peachy/simple_content.rb

Instance Method Summary collapse

Methods included from Compatibility

#version_safe_method_id

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

#valueObject



11
12
13
14
# File 'lib/peachy/simple_content.rb', line 11

def value
  acts_as_only_child
  @xml.content
end