Class: NthuEvent::Event
- Inherits:
-
Object
- Object
- NthuEvent::Event
- Defined in:
- lib/nthuevent/event.rb
Overview
Single event on organiztion’s feed
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event_data) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(event_data) ⇒ Event
Returns a new instance of Event.
9 10 11 |
# File 'lib/nthuevent/event.rb', line 9 def initialize(event_data) load_data(event_data) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/nthuevent/event.rb', line 7 def content @content end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
7 8 9 |
# File 'lib/nthuevent/event.rb', line 7 def date @date end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
7 8 9 |
# File 'lib/nthuevent/event.rb', line 7 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/nthuevent/event.rb', line 7 def url @url end |
Class Method Details
.find(type: nil, page: nil) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/nthuevent/event.rb', line 13 def self.find(type: nil, page: nil) events_data = NthuEvent::NthuEventApi.events(type: type, page: page) events = events_data.map do |event_data| new(event_data) end events end |