Class: Etna::Clients::Metis::File
- Inherits:
-
Object
- Object
- Etna::Clients::Metis::File
- Defined in:
- lib/etna/clients/metis/models.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #bucket_name ⇒ Object
- #download_path ⇒ Object
- #download_url ⇒ Object
- #file_name ⇒ Object
- #file_path ⇒ Object
-
#initialize(raw = {}) ⇒ File
constructor
A new instance of File.
- #project_name ⇒ Object
- #size ⇒ Object
- #updated_at ⇒ Object
Constructor Details
#initialize(raw = {}) ⇒ File
Returns a new instance of File.
204 205 206 |
# File 'lib/etna/clients/metis/models.rb', line 204 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
202 203 204 |
# File 'lib/etna/clients/metis/models.rb', line 202 def raw @raw end |
Instance Method Details
#bucket_name ⇒ Object
216 217 218 |
# File 'lib/etna/clients/metis/models.rb', line 216 def bucket_name raw[:bucket_name] end |
#download_path ⇒ Object
220 221 222 223 224 |
# File 'lib/etna/clients/metis/models.rb', line 220 def download_path raw[:download_url].nil? ? "/#{project_name}/download/#{bucket_name}/#{file_path}" : raw[:download_url].sub(%r!^https://[^/]*?/!, '/') end |
#download_url ⇒ Object
226 227 228 |
# File 'lib/etna/clients/metis/models.rb', line 226 def download_url raw[:download_url] || '' end |
#file_name ⇒ Object
230 231 232 |
# File 'lib/etna/clients/metis/models.rb', line 230 def file_name raw[:file_name] end |
#file_path ⇒ Object
208 209 210 |
# File 'lib/etna/clients/metis/models.rb', line 208 def file_path raw[:file_path] end |
#project_name ⇒ Object
212 213 214 |
# File 'lib/etna/clients/metis/models.rb', line 212 def project_name raw[:project_name] end |
#size ⇒ Object
239 240 241 |
# File 'lib/etna/clients/metis/models.rb', line 239 def size raw[:size] end |
#updated_at ⇒ Object
234 235 236 237 |
# File 'lib/etna/clients/metis/models.rb', line 234 def updated_at time = raw[:updated_at] time.nil? ? nil : Time.parse(time) end |