Class: Nelumba::Event
Constant Summary
Constants included from Object
Object::USERNAME_REGULAR_EXPRESSION
Instance Attribute Summary collapse
-
#attending ⇒ Object
readonly
Returns the value of attribute attending.
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#maybe_attending ⇒ Object
readonly
Returns the value of attribute maybe_attending.
-
#not_attending ⇒ Object
readonly
Returns the value of attribute not_attending.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Attributes included from Object
#author, #content, #display_name, #html, #image, #published, #summary, #text, #title, #uid, #updated, #url
Instance Method Summary collapse
- #init(options = {}, &blk) ⇒ Object
-
#initialize(options = {}, &blk) ⇒ Event
constructor
A new instance of Event.
- #to_hash ⇒ Object
- #to_json_hash ⇒ Object
Methods included from Object
#mentions, #reply_to, #to_as1, #to_html, #to_json, #to_text
Constructor Details
#initialize(options = {}, &blk) ⇒ Event
Returns a new instance of Event.
14 15 16 |
# File 'lib/nelumba/event.rb', line 14 def initialize( = {}, &blk) init(, &blk) end |
Instance Attribute Details
#attending ⇒ Object (readonly)
Returns the value of attribute attending.
5 6 7 |
# File 'lib/nelumba/event.rb', line 5 def attending @attending end |
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
10 11 12 |
# File 'lib/nelumba/event.rb', line 10 def end_time @end_time end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
12 13 14 |
# File 'lib/nelumba/event.rb', line 12 def location @location end |
#maybe_attending ⇒ Object (readonly)
Returns the value of attribute maybe_attending.
6 7 8 |
# File 'lib/nelumba/event.rb', line 6 def maybe_attending @maybe_attending end |
#not_attending ⇒ Object (readonly)
Returns the value of attribute not_attending.
7 8 9 |
# File 'lib/nelumba/event.rb', line 7 def not_attending @not_attending end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
9 10 11 |
# File 'lib/nelumba/event.rb', line 9 def start_time @start_time end |
Instance Method Details
#init(options = {}, &blk) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nelumba/event.rb', line 18 def init( = {}, &blk) super @attending = [:attending] || [] @maybe_attending = [:maybe_attending] || [] @not_attending = [:not_attending] || [] @start_time = [:start_time] @end_time = [:end_time] @location = [:location] end |
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/nelumba/event.rb', line 29 def to_hash { :attending => @attending.dup, :maybe_attending => @maybe_attending.dup, :not_attending => @not_attending.dup, :start_time => @start_time, :end_time => @end_time, :location => @location }.merge(super) end |
#to_json_hash ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/nelumba/event.rb', line 42 def to_json_hash { :objectType => "event", :attending => @attending.dup, :maybeAttending => @maybe_attending.dup, :notAttending => @not_attending.dup, :startTime => (@start_time && @start_time.to_date.rfc3339 + 'Z'), :endTime => (@end_time && @end_time.to_date.rfc3339 + 'Z'), :location => @location }.merge(super) end |