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.
11 12 13 |
# File 'lib/x2ch.rb', line 11 def initialize() @categories = [] end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
9 10 11 |
# File 'lib/x2ch.rb', line 9 def categories @categories end |
Class Method Details
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 |