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.



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

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

Instance Attribute Details

#datObject

Returns the value of attribute dat.



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

def dat
  @dat
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#numObject

Returns the value of attribute num.



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

def num
  @num
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#each(&blk) ⇒ Object



93
94
95
96
97
# File 'lib/x2ch.rb', line 93

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

#posts(if_modified_since = nil, range = nil) ⇒ Object



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

def posts(if_modified_since = nil, range = nil)
	res = Dat.download(@url + "dat/" + @dat, if_modified_since, range)
	ArrayResponse.new(Dat.parse(res), res.status, res.last_modified, res.content_encoding, res.body_size)
end