Class: MeetupCli::Activity

Inherits:
Object
  • Object
show all
Defined in:
lib/meetup_cli/activity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, tag_line) ⇒ Activity

Returns a new instance of Activity.



4
5
6
7
8
# File 'lib/meetup_cli/activity.rb', line 4

def initialize(name, url, tag_line)
  @name = name
  @url = url
  @tag_line = tag_line
end

Instance Attribute Details

#aboutObject

Returns the value of attribute about.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def about
  @about
end

#locationObject

Returns the value of attribute location.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def location
  @location
end

#meetupObject

Returns the value of attribute meetup.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def meetup
  @meetup
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def name
  @name
end

#organiserObject

Returns the value of attribute organiser.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def organiser
  @organiser
end

#tag_lineObject

Returns the value of attribute tag_line.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def tag_line
  @tag_line
end

#total_membersObject

Returns the value of attribute total_members.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def total_members
  @total_members
end

#type_of_groupObject

Returns the value of attribute type_of_group.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def type_of_group
  @type_of_group
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/meetup_cli/activity.rb', line 2

def url
  @url
end

Instance Method Details

#display_meetupsObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/meetup_cli/activity.rb', line 16

def display_meetups
  list_meetup
  puts "Name: #{@name}"
  puts "Location: #{@location}"
  puts "Type of Group: #{@type_of_group}"
  puts "Organised by:#{@organiser}"
  puts "Total Member#{@total_members}"
  puts "About: #{@about}"
  if @meetup.upcoming
    @meetup.display
  else
    puts "----------------------------------"
    puts "Sorry no upcoming meetups!!"
    puts "----------------------------------"
  end
end

#list_meetupObject



10
11
12
13
14
# File 'lib/meetup_cli/activity.rb', line 10

def list_meetup
# scrape url/events gives no upcoming meetups set up the method upcoming? = false
#create the meetup
MeetupCli::Scraper.list_meetup(self)
end