Class: GoodData::Rest::Object
- Extended by:
- Mixin::DataPropertyReader, Mixin::DataPropertyWriter, Mixin::MetaPropertyReader, Mixin::MetaPropertyWriter
- Defined in:
- lib/gooddata/rest/object.rb
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
Instance Attribute Summary collapse
- #client(opts = {}) ⇒ Object
-
#json ⇒ Object
(also: #raw_data, #to_hash, #to_json)
Returns the value of attribute json.
-
#project ⇒ Object
Returns the value of attribute project.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(_opts = {}) ⇒ Object
constructor
A new instance of Object.
- #saved? ⇒ Boolean
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
#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 |
#json ⇒ Object 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 |
#project ⇒ Object
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_client ⇒ Object
62 63 |
# File 'lib/gooddata/rest/object.rb', line 62 def default_client end |
Instance Method Details
#saved? ⇒ Boolean
57 58 59 |
# File 'lib/gooddata/rest/object.rb', line 57 def saved? !uri.blank? end |