Class: ForwardCalendar::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/forward_calendar/node.rb

Direct Known Subclasses

ForwardCalendar, Updated

Instance Method Summary collapse

Instance Method Details

#to_hashObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/forward_calendar/node.rb', line 4

def to_hash
  hash = {}
  attributes = self.class.instance_variable_get(:@attributes)
  elements = self.class.instance_variable_get(:@elements)
  content = 
  (attributes.to_a + elements.to_a + content.to_a).each do |k, _|
    value = send(k)
    hash[k] = serialize_attribute(value)
  end
  hash
end