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)

    スレッド



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

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

Instance Method Details

#kako_log?Boolean

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

Returns:

  • (Boolean)

    過去ログか否か



24
25
26
27
# File 'lib/simple2ch/dat.rb', line 24

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

#resesArray<Res>

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

Returns:

  • (Array<Res>)

    レス



17
18
19
20
# File 'lib/simple2ch/dat.rb', line 17

def reses
  parse_dat unless @reses
  @reses
end