lib/simple2ch/thre.rb in simple2ch-0.1.7 vs lib/simple2ch/thre.rb in simple2ch-0.1.8

- old
+ new

@@ -1,9 +1,7 @@ module Simple2ch class Thre - # @return [String] スレッドの名前 - attr_reader :title # @return [String] スレッドキー(Unix time) attr_reader :thread_key # @return [Fixnum] 返信の数 attr_reader :num_of_response # @return [Board] 属する板 @@ -101,9 +99,18 @@ # スレのdatURLを返す # @return [String] スレのdatURL def dat_url tld = type_of_2ch == :sc ? :sc : :net "http://#{@board.server_name}.#{type_of_2ch==:open ? 'open' : ''}2ch.#{tld}/#{@board.board_name}/dat/#{@thread_key}.dat" + end + + # タイトルを返す + # @return [String] スレッドの名前 + def title + unless @title + fetch_dat + end + @title end private # 全てのレスに対し、あるレスへのアンカーが書き込まれているレス番号のハッシュを返す # @return [Hash]{ res_num<Fixnum> => res_nums<Array<Fixnum>> } レス番号のハッシュ \ No newline at end of file