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.
40 41 42 43 |
# File 'lib/x2ch.rb', line 40 def initialize(name) @name = name @boards = [] end |
Instance Attribute Details
#boards ⇒ Object
Returns the value of attribute boards.
38 39 40 |
# File 'lib/x2ch.rb', line 38 def boards @boards end |
#name ⇒ Object
Returns the value of attribute name.
38 39 40 |
# File 'lib/x2ch.rb', line 38 def name @name end |
Instance Method Details
#[](bname) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/x2ch.rb', line 45 def [](bname) @boards.each{|b| return b if b.name == bname } nil end |
#each(&blk) ⇒ Object
56 57 58 59 60 |
# File 'lib/x2ch.rb', line 56 def each(&blk) @boards.each{|b| yield b } end |
#push(board) ⇒ Object
52 53 54 |
# File 'lib/x2ch.rb', line 52 def push(board) @boards << board end |