Class: GoodData::Rest::Object

Overview

Base class dealing with REST endpoints

MUST Be interface for objects dealing with REST endpoints MUST provide way to work with remote REST-like API in unified manner. MUST NOT create new connections.

Direct Known Subclasses

Resource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#initialize(_opts = {}) ⇒ Object

Returns a new instance of Object.



49
50
51
# File 'lib/gooddata/rest/object.rb', line 49

def initialize(_opts = {})
  @client = nil
end

Instance Attribute Details

#client(opts = {}) ⇒ Object



53
54
55
# File 'lib/gooddata/rest/object.rb', line 53

def client(opts = {})
  @client || GoodData::Rest::Object.client(opts)
end

#jsonObject Also known as: raw_data, to_hash, to_json

Returns the value of attribute json.



40
41
42
# File 'lib/gooddata/rest/object.rb', line 40

def json
  @json
end

#projectObject

Returns the value of attribute project.



47
48
49
# File 'lib/gooddata/rest/object.rb', line 47

def project
  @project
end

Class Method Details

.client(opts = { :client => GoodData.connection }) ⇒ Object



65
66
67
# File 'lib/gooddata/rest/object.rb', line 65

def client(opts = { :client => GoodData.connection })
  opts[:client] # || GoodData.client
end

.default_clientObject



62
63
# File 'lib/gooddata/rest/object.rb', line 62

def default_client
end

Instance Method Details

#saved?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/gooddata/rest/object.rb', line 57

def saved?
  !uri.blank?
end