Class: Simple2ch::Dat

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thre) ⇒ Dat

Returns a new instance of Dat.

Parameters:

  • thre (Thre)

    スレッド



11
12
13
14
15
16
17
# File 'lib/simple2ch/dat.rb', line 11

def initialize(thre)
  @thre = thre
  @thread_key = thre.thread_key
  @data = nil
  @responses = nil
  @is_kako_log = nil
end

Instance Attribute Details

#thread_keyString (readonly)

Returns スレッドキー.

Returns:

  • (String)

    スレッドキー



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

def thread_key
  @thread_key
end

#titleString (readonly)

Returns タイトル.

Returns:

  • (String)

    タイトル



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

def title
  @title
end

#urlBbs2chUrlValidator::UrlInfo (readonly)

Returns dat URL.

Returns:

  • (Bbs2chUrlValidator::UrlInfo)

    dat URL



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

def url
  @url
end

Instance Method Details

#kako_log?Boolean

Datを解析して過去ログかどうかを返す

Returns:

  • (Boolean)

    過去ログか否か



28
29
30
31
# File 'lib/simple2ch/dat.rb', line 28

def kako_log?
  parse_dat if @is_kako_log.nil?
  @is_kako_log
end

#responsesArray<Res>

Datを解析して、レスを返す

Returns:

  • (Array<Res>)

    レス



21
22
23
24
# File 'lib/simple2ch/dat.rb', line 21

def responses
  parse_dat unless @responses
  @responses
end