Class: Torrent
- Inherits:
-
Object
- Object
- Torrent
- Defined in:
- lib/immutablebox.rb
Defined Under Namespace
Classes: Info
Instance Attribute Summary collapse
-
#announce ⇒ Object
readonly
Returns the value of attribute announce.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(img) ⇒ Torrent
constructor
A new instance of Torrent.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#announce ⇒ Object (readonly)
Returns the value of attribute announce.
54 55 56 |
# File 'lib/immutablebox.rb', line 54 def announce @announce end |
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
53 54 55 |
# File 'lib/immutablebox.rb', line 53 def creation_date @creation_date end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
52 53 54 |
# File 'lib/immutablebox.rb', line 52 def info @info end |
Class Method Details
.str2hex(str) ⇒ Object
12 13 14 |
# File 'lib/immutablebox.rb', line 12 def self.str2hex(str) str.unpack('C*').map{|v|"%02x" % v}.join end |
Instance Method Details
#inspect ⇒ Object
60 61 62 |
# File 'lib/immutablebox.rb', line 60 def inspect @info.inspect end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/immutablebox.rb', line 56 def to_s "%s&tr=%s" % [@info.to_s, CGI.escape(@announce)] end |