Class: Simple2ch::Board

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, url) ⇒ Board



15
16
17
18
19
20
# File 'lib/simple2ch/board.rb', line 15

def initialize(title, url)
  @server_name = @board_name = nil
  @url = validate_url url
  @title = title
  @thres = []
end

Instance Attribute Details

#board_nameString (readonly)



10
11
12
# File 'lib/simple2ch/board.rb', line 10

def board_name
  @board_name
end

#server_nameString (readonly)



8
9
10
# File 'lib/simple2ch/board.rb', line 8

def server_name
  @server_name
end

#titleString (readonly)



6
7
8
# File 'lib/simple2ch/board.rb', line 6

def title
  @title
end

#urlURI (readonly)



4
5
6
# File 'lib/simple2ch/board.rb', line 4

def url
  @url
end

Instance Method Details

#open2ch?Boolean

おーぷん2chか否かを返す



34
35
36
# File 'lib/simple2ch/board.rb', line 34

def open2ch?
  @f_open2ch && true
end

#thresArray<Thre>

板に属する全てのスレッドを返す



24
25
26
27
28
29
30
# File 'lib/simple2ch/board.rb', line 24

def thres
  if @thres.size > 0
    @thres
  else
    fetch_all_thres
  end
end