Class: X2CH::Bbs

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBbs

Returns a new instance of Bbs.



11
12
13
# File 'lib/x2ch.rb', line 11

def initialize()
	@categories = []
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



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

def categories
  @categories
end

Class Method Details

.loadObject



32
33
34
# File 'lib/x2ch.rb', line 32

def self.load()
	BbsMenu.parse(BbsMenu.download)
end

Instance Method Details

#[](cname) ⇒ Object



15
16
17
18
19
20
# File 'lib/x2ch.rb', line 15

def [](cname)
	@categories.each{|c|
		return c if c.name == cname
	}
	nil
end

#each(&blk) ⇒ Object



26
27
28
29
30
# File 'lib/x2ch.rb', line 26

def each(&blk)
	@categories.each{|c|
		yield c
	}
end

#push(category) ⇒ Object



22
23
24
# File 'lib/x2ch.rb', line 22

def push(category)
	@categories << category
end