Class: Wsapi::Object
- Inherits:
-
Object
show all
- Defined in:
- lib/wsapi/models/object.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(raw_data) ⇒ Object
Returns a new instance of Object.
5
6
7
|
# File 'lib/wsapi/models/object.rb', line 5
def initialize(raw_data)
@raw_data = raw_data
end
|
Instance Attribute Details
Returns the value of attribute raw_data.
3
4
5
|
# File 'lib/wsapi/models/object.rb', line 3
def raw_data
@raw_data
end
|
Class Method Details
.from_data(type, raw_data) ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/wsapi/models/object.rb', line 25
def self.from_data(type, raw_data)
if type && Wsapi.const_defined?(type)
Wsapi.const_get(type).new(raw_data)
else
Object.new(raw_data)
end
end
|
Instance Method Details
13
14
15
|
# File 'lib/wsapi/models/object.rb', line 13
def id
@raw_data['ObjectID']
end
|
9
10
11
|
# File 'lib/wsapi/models/object.rb', line 9
def name
@raw_data['_refObjectName']
end
|
17
18
19
|
# File 'lib/wsapi/models/object.rb', line 17
def url
@raw_data['_ref']
end
|
#workspace ⇒ Object
21
22
23
|
# File 'lib/wsapi/models/object.rb', line 21
def workspace
@raw_data["Workspace"]["_refObjectName"]
end
|