Class: X2CH::Thread

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, dat, name, num) ⇒ Thread

Returns a new instance of Thread.



83
84
85
# File 'lib/x2ch.rb', line 83

def initialize(url, dat, name, num)
  @url, @dat, @name, @num = url, dat, name, num
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



81
82
83
# File 'lib/x2ch.rb', line 81

def name
  @name
end

#numObject

Returns the value of attribute num.



81
82
83
# File 'lib/x2ch.rb', line 81

def num
  @num
end

#urlObject

Returns the value of attribute url.



81
82
83
# File 'lib/x2ch.rb', line 81

def url
  @url
end

Instance Method Details

#each(&blk) ⇒ Object



91
92
93
94
95
# File 'lib/x2ch.rb', line 91

def each(&blk)
  posts.each{|p| 
    yield p
  }
end

#postsObject



87
88
89
# File 'lib/x2ch.rb', line 87

def posts
  Dat.parse(Dat.download(@url + "dat/" + @dat))
end