Class: Simple2ch::Board
- Inherits:
-
Object
- Object
- Simple2ch::Board
- Defined in:
- lib/simple2ch/board.rb
Instance Attribute Summary collapse
-
#title ⇒ String
readonly
板のタイトル.
-
#updated_at ⇒ Time
readonly
板オブジェクト更新日時.
-
#url ⇒ Bbs2chUrlValidator::URL
readonly
板のURL.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(url, title: nil) ⇒ Board
constructor
A new instance of Board.
-
#threads ⇒ Array<Thre>
板に属する全てのスレッドを返す.
Constructor Details
#initialize(url, title: nil) ⇒ Board
Returns a new instance of Board.
14 15 16 17 18 |
# File 'lib/simple2ch/board.rb', line 14 def initialize(url, title: nil) @url = validate_url(url) @title = title @updated_at = Time.now end |
Instance Attribute Details
#title ⇒ String (readonly)
Returns 板のタイトル.
6 7 8 |
# File 'lib/simple2ch/board.rb', line 6 def title @title end |
#updated_at ⇒ Time (readonly)
Returns 板オブジェクト更新日時.
8 9 10 |
# File 'lib/simple2ch/board.rb', line 8 def updated_at @updated_at end |
#url ⇒ Bbs2chUrlValidator::URL (readonly)
Returns 板のURL.
4 5 6 |
# File 'lib/simple2ch/board.rb', line 4 def url @url end |
Instance Method Details
#==(other) ⇒ Object
26 27 28 |
# File 'lib/simple2ch/board.rb', line 26 def ==(other) @url.to_s == other.url.to_s end |
#threads ⇒ Array<Thre>
板に属する全てのスレッドを返す
22 23 24 |
# File 'lib/simple2ch/board.rb', line 22 def threads @threads ||= fetch_all_threads end |