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.



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

def initialize()
  @categories = []
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



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

def categories
  @categories
end

Class Method Details

.loadObject



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

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

Instance Method Details

#[](cname) ⇒ Object



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

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

#each(&blk) ⇒ Object



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

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

#push(category) ⇒ Object



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

def push(category)
  @categories << category
end