Class: GoodData::AnalyticalVisualizationObject

Inherits:
MdObject show all
Defined in:
lib/gooddata/models/metadata/analytical_visualization_object.rb

Direct Known Subclasses

AnalyticalDashboard, VisualizationObject

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

#client, #json, #project

Class Method Summary collapse

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

#identifier_to_uri

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

#uri_obj_id

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

#obj_id

Methods included from Mixin::Links

#links

Methods inherited from Rest::Resource

#initialize

Methods inherited from Rest::Object

client, default_client, #initialize, #saved?

Methods included from Mixin::DataPropertyReader

#data_property_reader

Methods included from Mixin::DataPropertyWriter

#data_property_writer

Methods included from Mixin::MetaPropertyReader

#metadata_property_reader

Methods included from Mixin::MetaPropertyWriter

#metadata_property_writer

Methods included from Mixin::MetaGetter

#meta

Methods included from Mixin::DataGetter

#data

Methods included from Mixin::RootKeyGetter

#root_key

Methods included from Mixin::ContentGetter

#content

Constructor Details

This class inherits a constructor from GoodData::MdObject

Class Method Details

.create(object_data, klass, empty_data_object = {}, assignable_properties = [], options = { :client => GoodData.client, :project => GoodData.project }) ⇒ Object

Create a specify object in the specify project

Parameters:

  • object_data (Hash)

    the data of object will be created

  • klass (Class)

    A class used for instantiating the returned data

  • empty_data_object (Hash) (defaults to: {})

    the empty data of object will be created

  • assignable_properties (Hash) (defaults to: [])

    the properties allow updating

  • options (Hash) (defaults to: { :client => GoodData.client, :project => GoodData.project })

    The project that the object will be created in

Returns:

  • klass object



19
20
21
22
23
24
25
26
27
# File 'lib/gooddata/models/metadata/analytical_visualization_object.rb', line 19

def create(object_data, klass, empty_data_object = {}, assignable_properties = [], options = { :client => GoodData.client, :project => GoodData.project })
  client, project = GoodData.get_client_and_project(GoodData::Helpers.symbolize_keys(options))

  res = client.create(klass, GoodData::Helpers.deep_dup(GoodData::Helpers.stringify_keys(empty_data_object)), :project => project)
  object_data.each do |k, v|
    res.send("#{k}=", v) if assignable_properties.include? k
  end
  res
end