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
18 19 20 21 |
# File 'lib/gooddata/models/execution_detail.rb', line 18 def initialize(json) super @json = json end |
Instance Attribute Details
#dirty ⇒ Object (readonly)
Returns the value of attribute dirty.
11 12 13 |
# File 'lib/gooddata/models/execution_detail.rb', line 11 def dirty @dirty end |
#json ⇒ Object (readonly) Also known as: data
Returns the value of attribute json.
11 12 13 |
# File 'lib/gooddata/models/execution_detail.rb', line 11 def json @json end |
Instance Method Details
#==(other) ⇒ Object
Compares two executions - based on their URI
76 77 78 |
# File 'lib/gooddata/models/execution_detail.rb', line 76 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
24 25 26 |
# File 'lib/gooddata/models/execution_detail.rb', line 24 def created Time.parse(json['executionDetail']['created']) end |
#error? ⇒ Boolean
Has execution failed?
29 30 31 |
# File 'lib/gooddata/models/execution_detail.rb', line 29 def error? status == :error end |
#finished ⇒ Object
Timestamp when execution was finished
34 35 36 |
# File 'lib/gooddata/models/execution_detail.rb', line 34 def finished Time.parse(json['executionDetail']['finished']) end |
#log ⇒ Object
Log for execution
39 40 41 |
# File 'lib/gooddata/models/execution_detail.rb', line 39 def log @client.get(json['executionDetail']['links']['log']) end |
#log_filename ⇒ Object
Filename of log
44 45 46 |
# File 'lib/gooddata/models/execution_detail.rb', line 44 def log_filename @client.get(json['executionDetail']['logFileName']) end |
#ok? ⇒ Boolean
Is execution ok?
49 50 51 |
# File 'lib/gooddata/models/execution_detail.rb', line 49 def ok? status == :ok end |
#started ⇒ Object
Timestamp when execution was started
54 55 56 |
# File 'lib/gooddata/models/execution_detail.rb', line 54 def started Time.parse(json['executionDetail']['started']) end |
#status ⇒ Object
Status of execution
59 60 61 |
# File 'lib/gooddata/models/execution_detail.rb', line 59 def status json['executionDetail']['status'].downcase.to_sym end |
#updated ⇒ Object
Timestamp when execution was updated
64 65 66 |
# File 'lib/gooddata/models/execution_detail.rb', line 64 def updated Time.parse(json['executionDetail']['updated']) end |
#uri ⇒ String
Returns URL
71 72 73 |
# File 'lib/gooddata/models/execution_detail.rb', line 71 def uri @json['executionDetail']['links']['self'] if @json && @json['executionDetail'] && @json['executionDetail']['links'] end |