Class: Nexaas::Async::Collector::Result
- Inherits:
-
Object
- Object
- Nexaas::Async::Collector::Result
- Defined in:
- lib/nexaas/async/collector/result.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#scope_id ⇒ Object
readonly
Returns the value of attribute scope_id.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
- #content ⇒ Object
- #content_is_ready? ⇒ Boolean
- #content_type ⇒ Object
- #extension ⇒ Object
- #filename ⇒ Object
-
#initialize(scope_id, id) ⇒ Result
constructor
A new instance of Result.
- #is_file? ⇒ Boolean
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/nexaas/async/collector/result.rb', line 14 def id @id end |
#scope_id ⇒ Object (readonly)
Returns the value of attribute scope_id.
14 15 16 |
# File 'lib/nexaas/async/collector/result.rb', line 14 def scope_id @scope_id end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
14 15 16 |
# File 'lib/nexaas/async/collector/result.rb', line 14 def storage @storage end |
Instance Method Details
#content ⇒ Object
22 23 24 |
# File 'lib/nexaas/async/collector/result.rb', line 22 def content Base64.decode64(object['content']) if content_is_ready? end |
#content_is_ready? ⇒ Boolean
26 27 28 |
# File 'lib/nexaas/async/collector/result.rb', line 26 def content_is_ready? object && object['scope_id'] == scope_id && object['content'] end |
#content_type ⇒ Object
38 39 40 |
# File 'lib/nexaas/async/collector/result.rb', line 38 def content_type object && object.dig('file', 'content_type') end |
#extension ⇒ Object
42 43 44 |
# File 'lib/nexaas/async/collector/result.rb', line 42 def extension object && object.dig('file', 'extension') end |
#filename ⇒ Object
34 35 36 |
# File 'lib/nexaas/async/collector/result.rb', line 34 def filename object && object.dig('file', 'name') end |
#is_file? ⇒ Boolean
30 31 32 |
# File 'lib/nexaas/async/collector/result.rb', line 30 def is_file? object && !object['file'].nil? end |