Class: EasyDownloader::Options
- Inherits:
-
Object
- Object
- EasyDownloader::Options
- Defined in:
- lib/easy_downloader/options.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#host ⇒ Object
Returns the value of attribute host.
-
#load_count ⇒ Object
Returns the value of attribute load_count.
-
#local_file ⇒ Object
Returns the value of attribute local_file.
-
#local_path ⇒ Object
Returns the value of attribute local_path.
-
#local_pattern ⇒ Object
Returns the value of attribute local_pattern.
-
#password ⇒ Object
Returns the value of attribute password.
-
#remote_file ⇒ Object
Returns the value of attribute remote_file.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
-
#remote_pattern ⇒ Object
Returns the value of attribute remote_pattern.
-
#result ⇒ Object
Returns the value of attribute result.
-
#successful ⇒ Object
Returns the value of attribute successful.
-
#type ⇒ Object
Returns the value of attribute type.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(*options) ⇒ Options
constructor
A new instance of Options.
- #to_dir_path(path) ⇒ Object
Constructor Details
#initialize(*options) ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/easy_downloader/options.rb', line 10 def initialize(*) @files = [] @successful = false @result = Result.new @load_count = 0 @options = ..each do |key, value| send("#{key}=".to_sym, value) if respond_to?("#{key}=".to_sym) end end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def files @files end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def host @host end |
#load_count ⇒ Object
Returns the value of attribute load_count.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def load_count @load_count end |
#local_file ⇒ Object
Returns the value of attribute local_file.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def local_file @local_file end |
#local_path ⇒ Object
Returns the value of attribute local_path.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def local_path @local_path end |
#local_pattern ⇒ Object
Returns the value of attribute local_pattern.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def local_pattern @local_pattern end |
#password ⇒ Object
Returns the value of attribute password.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def password @password end |
#remote_file ⇒ Object
Returns the value of attribute remote_file.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def remote_file @remote_file end |
#remote_path ⇒ Object
Returns the value of attribute remote_path.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def remote_path @remote_path end |
#remote_pattern ⇒ Object
Returns the value of attribute remote_pattern.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def remote_pattern @remote_pattern end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def result @result end |
#successful ⇒ Object
Returns the value of attribute successful.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def successful @successful end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def type @type end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/easy_downloader/options.rb', line 4 def user @user end |
Instance Method Details
#to_dir_path(path) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/easy_downloader/options.rb', line 30 def to_dir_path(path) if path path =~ /\/$/ ? path : path + '/' else '' end end |