Class: RMeetup::Type::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/rmeetup/type/topic.rb

Overview

RMeetup::Type::Topic

Data wraper for a Topic fethcing response Used to access result attributes as well as progammatically fetch relative data types based on this topic.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic = {}) ⇒ Topic

Returns a new instance of Topic.



13
14
15
16
17
18
19
20
21
# File 'lib/rmeetup/type/topic.rb', line 13

def initialize(topic = {})
  self.name         = topic['name']
  self.urlkey       = topic['urlkey']
  self.id           = topic['id'].to_i
  self.description  = topic['description']
  self.members      = topic['members'].to_i
  self.link         = topic['link']
  self.updated      = DateTime.parse(topic['updated'])
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def description
  @description
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def id
  @id
end

Returns the value of attribute link.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def link
  @link
end

#membersObject

Returns the value of attribute members.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def members
  @members
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def name
  @name
end

#updatedObject

Returns the value of attribute updated.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def updated
  @updated
end

#urlkeyObject

Returns the value of attribute urlkey.



11
12
13
# File 'lib/rmeetup/type/topic.rb', line 11

def urlkey
  @urlkey
end