Class: ODDB::Html::State::Drugs::Downloads::FileInfo
- Inherits:
-
Object
- Object
- ODDB::Html::State::Drugs::Downloads::FileInfo
- Defined in:
- lib/oddb/html/state/drugs/downloads.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #file_path ⇒ Object
-
#initialize(name) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #price(times = 1) ⇒ Object
- #size ⇒ Object
- #uncompressed? ⇒ Boolean
Constructor Details
#initialize(name) ⇒ FileInfo
Returns a new instance of FileInfo.
11 12 13 |
# File 'lib/oddb/html/state/drugs/downloads.rb', line 11 def initialize name @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/oddb/html/state/drugs/downloads.rb', line 10 def name @name end |
Instance Method Details
#file_path ⇒ Object
14 15 16 |
# File 'lib/oddb/html/state/drugs/downloads.rb', line 14 def file_path File.join ODDB.config.export_dir, @name end |
#price(times = 1) ⇒ Object
17 18 19 |
# File 'lib/oddb/html/state/drugs/downloads.rb', line 17 def price times=1 ODDB.config.prices["org.oddb.de.download.#{times}"][name] end |
#size ⇒ Object
20 21 22 |
# File 'lib/oddb/html/state/drugs/downloads.rb', line 20 def size File.size uncompressed? ? file_path : file_path + '.gz' end |