Class: Kusto::Rest::DataSet
- Inherits:
-
Object
- Object
- Kusto::Rest::DataSet
- Defined in:
- lib/kusto/rest/result/data_set.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #completion ⇒ Object
- #header ⇒ Object
-
#initialize(response) ⇒ DataSet
constructor
A new instance of DataSet.
- #primary_result ⇒ Object
- #rows ⇒ Object
Constructor Details
#initialize(response) ⇒ DataSet
Returns a new instance of DataSet.
13 14 15 |
# File 'lib/kusto/rest/result/data_set.rb', line 13 def initialize(response) @data = JSON.parse(response) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
11 12 13 |
# File 'lib/kusto/rest/result/data_set.rb', line 11 def data @data end |
Class Method Details
.parse_frame(frame) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/kusto/rest/result/data_set.rb', line 39 def self.parse_frame(frame) case frame["FrameType"] when "DataSetHeader" Kusto::Rest::DataSetHeader.new(frame) when "DataTable" Kusto::Rest::DataTable.new(frame) when "DataSetCompletion" Kusto::Rest::DataSetCompletion.new(frame) else Kusto::Result::DataFrame.new(frame) end end |
Instance Method Details
#completion ⇒ Object
33 34 35 36 37 |
# File 'lib/kusto/rest/result/data_set.rb', line 33 def completion @completion ||= frames.find_all do |frame| frame.type == "DataSetCompletion" end.first end |
#header ⇒ Object
29 30 31 |
# File 'lib/kusto/rest/result/data_set.rb', line 29 def header @header ||= frames.find_all { |frame| frame.type == "DataSetHeader" }.first end |
#primary_result ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/kusto/rest/result/data_set.rb', line 21 def primary_result @primary_result ||= frames.find_all do |frame| frame.type == "DataTable" && frame.kind == "PrimaryResult" && frame.name == "PrimaryResult" end.first end |
#rows ⇒ Object
17 18 19 |
# File 'lib/kusto/rest/result/data_set.rb', line 17 def rows primary_result.rows end |