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)

    スレッド



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

def initialize(thre)
  @thre = thre
  @thread_key = thre.thread_key
  @data = nil
  @reses = nil
  @f_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

Instance Method Details

#kako_log?Boolean

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

Returns:

  • (Boolean)

    過去ログか否か



26
27
28
29
# File 'lib/simple2ch/dat.rb', line 26

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

#resesArray<Res>

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

Returns:

  • (Array<Res>)

    レス



19
20
21
22
# File 'lib/simple2ch/dat.rb', line 19

def reses
  parse_dat unless @reses
  @reses
end