Class: KktixEvent::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/kktix-api/event.rb

Overview

Single event on organiztion’s feed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_data) ⇒ Event

Returns a new instance of Event.



9
10
11
# File 'lib/kktix-api/event.rb', line 9

def initialize(event_data)
  load_data(event_data)
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



7
8
9
# File 'lib/kktix-api/event.rb', line 7

def author
  @author
end

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/kktix-api/event.rb', line 7

def content
  @content
end

#summaryObject (readonly)

Returns the value of attribute summary.



7
8
9
# File 'lib/kktix-api/event.rb', line 7

def summary
  @summary
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/kktix-api/event.rb', line 7

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/kktix-api/event.rb', line 7

def url
  @url
end

Class Method Details

.search(query) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/kktix-api/event.rb', line 13

def self.search(query)
  events_hash = KktixApi.search(query)
  events = events_hash.map do |event_hash|
    new(event_hash)
  end
  events
end