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.



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

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

Instance Attribute Details

#client(opts = {}) ⇒ Object



51
52
53
# File 'lib/gooddata/rest/object.rb', line 51

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.



38
39
40
# File 'lib/gooddata/rest/object.rb', line 38

def json
  @json
end

#projectObject

Returns the value of attribute project.



45
46
47
# File 'lib/gooddata/rest/object.rb', line 45

def project
  @project
end

Class Method Details

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



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

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

.default_clientObject



60
61
# File 'lib/gooddata/rest/object.rb', line 60

def default_client
end

Instance Method Details

#saved?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/gooddata/rest/object.rb', line 55

def saved?
  !uri.blank?
end