Class: TildeScraper::Group

Inherits:
Object
  • Object
show all
Extended by:
Memorable::ClassMethods
Includes:
Memorable::InstanceMethods
Defined in:
lib/tilde_scraper/group.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Memorable::ClassMethods

create, create_from_array

Methods included from Memorable::InstanceMethods

#add_attributes, #initialize

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/tilde_scraper/group.rb', line 5

def description
  @description
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/tilde_scraper/group.rb', line 5

def name
  @name
end

#subsObject

Returns the value of attribute subs.



5
6
7
# File 'lib/tilde_scraper/group.rb', line 5

def subs
  @subs
end

Class Method Details

.allObject



9
10
11
# File 'lib/tilde_scraper/group.rb', line 9

def self.all
  @@all
end

.displayObject



22
23
24
25
26
27
28
# File 'lib/tilde_scraper/group.rb', line 22

def self.display
  all.each.with_index(1) do |group, index|
    puts index
    group.display
    puts ""
  end
end

Instance Method Details

#displayObject



13
14
15
16
# File 'lib/tilde_scraper/group.rb', line 13

def display
  puts name
  puts description + "    " + subs
end

#get_urlObject



18
19
20
# File 'lib/tilde_scraper/group.rb', line 18

def get_url
  "https://tildes.net/#{name}"
end