Module: DbAgile::Contract::Data::Dataset
- Defined in:
- lib/dbagile/contract/data/dataset.rb
Instance Method Summary collapse
-
#allbut(*cs) ⇒ Object
Makes an allbut selection.
-
#to_csv(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a CSV string.
-
#to_html(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a HTML string.
-
#to_json(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a JSON string.
-
#to_ruby(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a Ruby Array of hashes string.
-
#to_text(buffer = "", options = {}) ⇒ ...
Outputs this dataset as plain text.
-
#to_xml(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a XML string.
-
#to_yaml(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a YAML string.
Instance Method Details
#allbut(*cs) ⇒ Object
Makes an allbut selection
7 8 9 10 |
# File 'lib/dbagile/contract/data/dataset.rb', line 7 def allbut(*cs) arr = self.columns - cs.flatten select(*arr) end |
#to_csv(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a CSV string.
17 18 19 |
# File 'lib/dbagile/contract/data/dataset.rb', line 17 def to_csv(buffer = "", = {}) DbAgile::IO::CSV::to_csv(self, self.columns, buffer, ) end |
#to_html(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a HTML string
53 54 55 |
# File 'lib/dbagile/contract/data/dataset.rb', line 53 def to_html(buffer = "", = {}) DbAgile::IO::HTML::to_html(self, self.columns, buffer, ) end |
#to_json(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a JSON string
26 27 28 |
# File 'lib/dbagile/contract/data/dataset.rb', line 26 def to_json(buffer = "", = {}) DbAgile::IO::JSON::to_json(self.to_a, self.columns, buffer, ) end |
#to_ruby(buffer = "", options = {}) ⇒ ...
Outputs this dataset as a Ruby Array of hashes string
62 63 64 |
# File 'lib/dbagile/contract/data/dataset.rb', line 62 def to_ruby(buffer = "", = {}) DbAgile::IO::Ruby::to_ruby(self, self.columns, buffer, ) end |
#to_text(buffer = "", options = {}) ⇒ ...
Outputs this dataset as plain text
71 72 73 |
# File 'lib/dbagile/contract/data/dataset.rb', line 71 def to_text(buffer = "", = {}) DbAgile::IO::Text::to_text(self, self.columns, buffer, ) end |