Class: X2CH::Bbs
- Inherits:
-
Object
- Object
- X2CH::Bbs
- Defined in:
- lib/x2ch.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
Class Method Summary collapse
Instance Method Summary collapse
- #[](cname) ⇒ Object
- #each(&blk) ⇒ Object
-
#initialize ⇒ Bbs
constructor
A new instance of Bbs.
- #push(category) ⇒ Object
Constructor Details
#initialize ⇒ Bbs
Returns a new instance of Bbs.
12 13 14 |
# File 'lib/x2ch.rb', line 12 def initialize() @categories = [] end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
10 11 12 |
# File 'lib/x2ch.rb', line 10 def categories @categories end |
Class Method Details
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 |