Class: Fanfeedrb::Fanfeedr::Event

Inherits:
Abstract
  • Object
show all
Defined in:
lib/fanfeedrb/fanfeedr/event.rb

Instance Method Summary collapse

Methods inherited from Abstract

accessor, date_reader, #id, reader

Constructor Details

#initialize(event, attributes = {}) ⇒ Event

Returns a new instance of Event.



13
14
15
16
# File 'lib/fanfeedrb/fanfeedr/event.rb', line 13

def initialize(event, attributes = {})
  @event = event
  super(attributes)
end

Instance Method Details

#happeninObject



9
10
11
# File 'lib/fanfeedrb/fanfeedr/event.rb', line 9

def happenin
  date && Date.new(date.year, date.mon, date.day)
end

#inspectObject



22
23
24
# File 'lib/fanfeedrb/fanfeedr/event.rb', line 22

def inspect
  "#<#{self.class.inspect}:#{id.inspect}, event_id: #{id.inspect}, date: #{happenin.inspect} >"
end

#to_xmlObject



18
19
20
# File 'lib/fanfeedrb/fanfeedr/event.rb', line 18

def to_xml
  Fanfeedrb.hash_to_xml(:task, @attributes)
end