Class: GoodData::Dataset
- Inherits:
-
MdObject
- Object
- Rest::Object
- Rest::Resource
- MdObject
- GoodData::Dataset
- Defined in:
- lib/gooddata/models/metadata/dataset.rb
Constant Summary
Constants inherited from MdObject
MdObject::IDENTIFIERS_CFG, MdObject::MD_OBJ_CTG
Constants included from Mixin::MdIdToUri
Mixin::MdIdToUri::IDENTIFIERS_CFG
Constants included from Mixin::MdObjectIndexer
Mixin::MdObjectIndexer::MD_OBJ_CTG
Constants included from Mixin::MdObjectQuery
Mixin::MdObjectQuery::ERROR_MESSAGE_NO_PROJECT
Instance Attribute Summary
Attributes inherited from Rest::Object
Class Method Summary collapse
-
.all(options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Array<GoodData::MdObject> | Array<Hash>
Method intended to get all objects of that type in a specified project.
Instance Method Summary collapse
-
#attribute_uris ⇒ Array<String>
Gives you list of attribute uris on a dataset.
-
#attributes ⇒ Array<GoodData::Attribute>
Gives you list of attributes on a dataset.
-
#date_dimension? ⇒ Boolean
Tells you if a dataset is a date dimension.
-
#fact_uris ⇒ Array<String>
Gives you list of fact uris on a dataset.
-
#facts ⇒ Array<GoodData::Fact>
Gives you list of facts on a dataset.
-
#synchronize ⇒ Object
(also: #delete_data)
Delete the data in a dataset.
Methods inherited from MdObject
#==, #add_tag, #browser_uri, #delete, #deprecated, #deprecated=, find_replaceable_values, #get_flag?, #initialize, #listed?, #production, #production=, #project, #reload!, #remove_tag, replace, #replace, #replace!, replace_bracketed, replace_quoted, #restricted, #restricted=, #save, #save_as, #set_flag, #tag_set, #unlisted, #unlisted=, #validate
Methods included from Mixin::MdIdToUri
Methods included from Mixin::MdObjectIndexer
Methods included from Mixin::MdObjectQuery
#all, #dependency, #dependency?, #query, #usedby, #usedby?, #using, #using?
Methods included from Mixin::MdFinders
#find_by_identifier, #find_by_tag, #find_by_title, #find_first_by_identifier, #find_first_by_title
Methods included from Mixin::MdObjId
Methods included from Mixin::MdGrantees
#change_permission, #grant, #grantees, #revoke
Methods included from Mixin::MdRelations
#dependency, #dependency?, #usedby, #usedby?, #using, #using?
Methods included from Mixin::ObjId
Methods included from Mixin::Links
Methods inherited from Rest::Resource
Methods inherited from Rest::Object
client, default_client, #initialize, #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::DataGetter
Methods included from Mixin::RootKeyGetter
Methods included from Mixin::ContentGetter
Constructor Details
This class inherits a constructor from GoodData::MdObject
Class Method Details
.all(options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Array<GoodData::MdObject> | Array<Hash>
Method intended to get all objects of that type in a specified project
to pull in full objects. This is desirable from the usability POV but unfortunately has negative impact on performance so it is not the default.
20 21 22 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 20 def all( = { :client => GoodData.connection, :project => GoodData.project }) query('dataSet', Dataset, ) end |
Instance Method Details
#attribute_uris ⇒ Array<String>
Gives you list of attribute uris on a dataset
35 36 37 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 35 def attribute_uris content['attributes'] end |
#attributes ⇒ Array<GoodData::Attribute>
Gives you list of attributes on a dataset
28 29 30 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 28 def attributes attribute_uris.pmap { |a_uri| project.attributes(a_uri) } end |
#date_dimension? ⇒ Boolean
Tells you if a dataset is a date dimension. This is done by looking at the attributes and inspecting their identifiers.
57 58 59 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 57 def date_dimension? content['urn'] && !content['urn'].empty? && fact_uris.empty? end |
#fact_uris ⇒ Array<String>
Gives you list of fact uris on a dataset
49 50 51 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 49 def fact_uris content['facts'] end |
#facts ⇒ Array<GoodData::Fact>
Gives you list of facts on a dataset
42 43 44 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 42 def facts fact_uris.pmap { |a_uri| project.facts(a_uri) } end |
#synchronize ⇒ Object Also known as: delete_data
Delete the data in a dataset
62 63 64 |
# File 'lib/gooddata/models/metadata/dataset.rb', line 62 def synchronize project.execute_maql("SYNCHRONIZE {#{identifier}}") end |