Class: Nemweb::DataFile
- Inherits:
-
Struct
- Object
- Struct
- Nemweb::DataFile
- Defined in:
- lib/nemweb/data_file.rb
Instance Attribute Summary collapse
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, client) ⇒ DataFile
constructor
A new instance of DataFile.
- #name ⇒ Object
- #parse(&block) ⇒ Object
- #period ⇒ Object
Constructor Details
#initialize(uri, client) ⇒ DataFile
Returns a new instance of DataFile.
5 6 7 8 |
# File 'lib/nemweb/data_file.rb', line 5 def initialize(uri, client) super(uri) @client = client end |
Instance Attribute Details
#uri ⇒ Object
Returns the value of attribute uri
3 4 5 |
# File 'lib/nemweb/data_file.rb', line 3 def uri @uri end |
Instance Method Details
#name ⇒ Object
10 11 12 |
# File 'lib/nemweb/data_file.rb', line 10 def name File.basename(uri.path) end |
#parse(&block) ⇒ Object
18 19 20 |
# File 'lib/nemweb/data_file.rb', line 18 def parse(&block) @client.parse(uri, &block) end |
#period ⇒ Object
14 15 16 |
# File 'lib/nemweb/data_file.rb', line 14 def period name.scan(/_(\d{4,})/).first.first end |