Class: Annal::Fetch::NetFile
- Inherits:
-
Object
- Object
- Annal::Fetch::NetFile
- Defined in:
- lib/annal/fetch/net_file.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(file_identifier) ⇒ NetFile
constructor
A new instance of NetFile.
- #local? ⇒ Boolean
- #read ⇒ Object
Constructor Details
#initialize(file_identifier) ⇒ NetFile
Returns a new instance of NetFile.
7 8 9 10 11 12 13 |
# File 'lib/annal/fetch/net_file.rb', line 7 def initialize(file_identifier) self.file = if file_identifier.respond_to?(:read) file_identifier else self.file = RestClient.get(file_identifier) end end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
6 7 8 |
# File 'lib/annal/fetch/net_file.rb', line 6 def file @file end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/annal/fetch/net_file.rb', line 6 def path @path end |
Instance Method Details
#local? ⇒ Boolean
15 16 17 |
# File 'lib/annal/fetch/net_file.rb', line 15 def local? false end |
#read ⇒ Object
19 20 21 |
# File 'lib/annal/fetch/net_file.rb', line 19 def read @read ||= file.to_str end |