Class: X2CH::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/x2ch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#boardsObject

Returns the value of attribute boards.



38
39
40
# File 'lib/x2ch.rb', line 38

def boards
  @boards
end

#nameObject

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