Class: Airdata::DataDownloader
- Inherits:
-
Object
- Object
- Airdata::DataDownloader
- Defined in:
- lib/airdata.rb
Instance Attribute Summary collapse
-
#local ⇒ Object
Returns the value of attribute local.
-
#name ⇒ Object
Returns the value of attribute name.
-
#remote ⇒ Object
Returns the value of attribute remote.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ DataDownloader
constructor
A new instance of DataDownloader.
Constructor Details
#initialize(name) ⇒ DataDownloader
Returns a new instance of DataDownloader.
9 10 11 12 13 14 |
# File 'lib/airdata.rb', line 9 def initialize(name) @name = name @local = "#{Dir.tmpdir}/#{@name}.airdata" @remote = "http://files.rubystudio.net/airdata/#{@name}.airdata" create_local_file end |
Instance Attribute Details
#local ⇒ Object
Returns the value of attribute local.
7 8 9 |
# File 'lib/airdata.rb', line 7 def local @local end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/airdata.rb', line 7 def name @name end |
#remote ⇒ Object
Returns the value of attribute remote.
7 8 9 |
# File 'lib/airdata.rb', line 7 def remote @remote end |
Class Method Details
.cycle ⇒ Object
16 17 18 |
# File 'lib/airdata.rb', line 16 def self.cycle Airdata::Airoption.last.value end |
.latest_cycle ⇒ Object
20 21 22 23 |
# File 'lib/airdata.rb', line 20 def self.latest_cycle txt = "http://files.rubystudio.net/airdata/cycle.airdata" Curl::Easy.perform(txt).body_str[0..3] end |