Class: GoodData::ExecutionDetail
- Inherits:
-
Rest::Resource
- Object
- Rest::Object
- Rest::Resource
- GoodData::ExecutionDetail
- Defined in:
- lib/gooddata/models/execution_detail.rb
Instance Attribute Summary collapse
-
#dirty ⇒ Object
readonly
Returns the value of attribute dirty.
-
#json ⇒ Object
(also: #data)
readonly
Returns the value of attribute json.
Attributes inherited from Rest::Object
Instance Method Summary collapse
-
#==(other) ⇒ Object
Compares two executions - based on their URI.
-
#created ⇒ Object
Timestamp when execution was created.
-
#error? ⇒ Boolean
Has execution failed?.
-
#finished ⇒ Object
Timestamp when execution was finished.
-
#initialize(json) ⇒ ExecutionDetail
constructor
Initializes object instance from raw wire JSON.
-
#log ⇒ Object
Log for execution.
-
#log_filename ⇒ Object
Filename of log.
-
#ok? ⇒ Boolean
Is execution ok?.
-
#started ⇒ Object
Timestamp when execution was started.
-
#status ⇒ Object
Status of execution.
-
#updated ⇒ Object
Timestamp when execution was updated.
-
#uri ⇒ String
Returns URL.
Methods included from Mixin::ObjId
Methods inherited from Rest::Object
client, default_client, #saved?
Methods included from Mixin::DataPropertyReader
Methods included from Mixin::DataPropertyWriter
Methods included from Mixin::MetaPropertyReader
Methods included from Mixin::MetaPropertyWriter
Methods included from Mixin::MetaGetter
Methods included from Mixin::RootKeyGetter
Methods included from Mixin::ContentGetter
Constructor Details
#initialize(json) ⇒ ExecutionDetail
Initializes object instance from raw wire JSON
19 20 21 22 |
# File 'lib/gooddata/models/execution_detail.rb', line 19 def initialize(json) super @json = json end |
Instance Attribute Details
#dirty ⇒ Object (readonly)
Returns the value of attribute dirty.
12 13 14 |
# File 'lib/gooddata/models/execution_detail.rb', line 12 def dirty @dirty end |
#json ⇒ Object (readonly) Also known as: data
Returns the value of attribute json.
12 13 14 |
# File 'lib/gooddata/models/execution_detail.rb', line 12 def json @json end |
Instance Method Details
#==(other) ⇒ Object
Compares two executions - based on their URI
77 78 79 |
# File 'lib/gooddata/models/execution_detail.rb', line 77 def ==(other) other.respond_to?(:uri) && other.uri == uri && other.respond_to?(:to_hash) && other.to_hash == to_hash end |
#created ⇒ Object
Timestamp when execution was created
25 26 27 |
# File 'lib/gooddata/models/execution_detail.rb', line 25 def created Time.parse(json['executionDetail']['created']) end |
#error? ⇒ Boolean
Has execution failed?
30 31 32 |
# File 'lib/gooddata/models/execution_detail.rb', line 30 def error? status == :error end |
#finished ⇒ Object
Timestamp when execution was finished
35 36 37 |
# File 'lib/gooddata/models/execution_detail.rb', line 35 def finished Time.parse(json['executionDetail']['finished']) end |
#log ⇒ Object
Log for execution
40 41 42 |
# File 'lib/gooddata/models/execution_detail.rb', line 40 def log @client.get(json['executionDetail']['links']['log']) end |
#log_filename ⇒ Object
Filename of log
45 46 47 |
# File 'lib/gooddata/models/execution_detail.rb', line 45 def log_filename @client.get(json['executionDetail']['logFileName']) end |
#ok? ⇒ Boolean
Is execution ok?
50 51 52 |
# File 'lib/gooddata/models/execution_detail.rb', line 50 def ok? status == :ok end |
#started ⇒ Object
Timestamp when execution was started
55 56 57 |
# File 'lib/gooddata/models/execution_detail.rb', line 55 def started Time.parse(json['executionDetail']['started']) end |
#status ⇒ Object
Status of execution
60 61 62 |
# File 'lib/gooddata/models/execution_detail.rb', line 60 def status json['executionDetail']['status'].downcase.to_sym end |
#updated ⇒ Object
Timestamp when execution was updated
65 66 67 |
# File 'lib/gooddata/models/execution_detail.rb', line 65 def updated Time.parse(json['executionDetail']['updated']) end |
#uri ⇒ String
Returns URL
72 73 74 |
# File 'lib/gooddata/models/execution_detail.rb', line 72 def uri @json['executionDetail']['links']['self'] if @json && @json['executionDetail'] && @json['executionDetail']['links'] end |