Class: X2CH::Category
- Inherits:
-
Object
- Object
- X2CH::Category
- Defined in:
- lib/x2ch.rb
Instance Attribute Summary collapse
-
#boards ⇒ Object
Returns the value of attribute boards.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #[](bname) ⇒ Object
- #each(&blk) ⇒ Object
-
#initialize(name) ⇒ Category
constructor
A new instance of Category.
- #push(board) ⇒ Object
Constructor Details
#initialize(name) ⇒ Category
Returns a new instance of Category.
41 42 43 44 |
# File 'lib/x2ch.rb', line 41 def initialize(name) @name = name @boards = [] end |
Instance Attribute Details
#boards ⇒ Object
Returns the value of attribute boards.
39 40 41 |
# File 'lib/x2ch.rb', line 39 def boards @boards end |
#name ⇒ Object
Returns the value of attribute name.
39 40 41 |
# File 'lib/x2ch.rb', line 39 def name @name end |
Instance Method Details
#[](bname) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/x2ch.rb', line 46 def [](bname) @boards.each{|b| return b if b.name == bname } nil end |
#each(&blk) ⇒ Object
57 58 59 60 61 |
# File 'lib/x2ch.rb', line 57 def each(&blk) @boards.each{|b| yield b } end |
#push(board) ⇒ Object
53 54 55 |
# File 'lib/x2ch.rb', line 53 def push(board) @boards << board end |