Class: UU::OS::Content::Row
- Inherits:
-
ContentClient
- Object
- ContentClient
- UU::OS::Content::Row
- Defined in:
- lib/uu/os/content/row.rb
Class Method Summary collapse
-
.create(sheet_uri, dto = nil) ⇒ Object
#create convenience self-instantiating shortcut.
-
.delete(sheet_uri, row_id) ⇒ Object
#delete convenience self-instantiating shortcut.
-
.get_attributes(sheet_uri, row_id) ⇒ Object
#get_attributes convenience self-instantiating shortcut.
-
.get_data(sheet_uri, row_id) ⇒ Object
#get_data convenience self-instantiating shortcut.
-
.set_attributes(sheet_uri, row = nil) ⇒ Object
#set_attributes convinience self-instantiating shortcut.
-
.set_constraints(sheet_uri, constraints = nil) ⇒ Object
#set_constraints convenience self-instantiating shortcut.
-
.set_data(sheet_uri, data = nil) ⇒ Object
#set_data convenience self-instantiating shortcut.
Instance Method Summary collapse
-
#create(sheet_uri, row = nil) ⇒ String
Creates a new row in a given sheet.
-
#delete(sheet_uri, row_id) ⇒ Object
Removes the given row from the structure of the content including its data.
-
#get_attributes(sheet_uri, row_id) ⇒ Hash
Retrieves the attributes of the given row.
-
#get_data(sheet_uri, row_id) ⇒ Array<Hash>
Retrieves the data of the given row in json format.
-
#initialize(session) ⇒ Row
constructor
Creates a new instance of
Row
. -
#set_attributes(sheet_uri, row = nil) ⇒ String
Updates basic attributes of the specified row.
-
#set_constraints(sheet_uri, constraints = nil) ⇒ Object
Sets constraints on the row.
-
#set_data(sheet_uri, data = nil) ⇒ Object
Modifies data structure of the given row.
Constructor Details
Class Method Details
.create(sheet_uri, dto = nil) ⇒ Object
#create convenience self-instantiating shortcut
69 70 71 72 |
# File 'lib/uu/os/content/row.rb', line 69 def self.create(sheet_uri, dto = nil) session = UU::OS::Security::Session.current_session self.new(session).create(sheet_uri, dto) end |
.delete(sheet_uri, row_id) ⇒ Object
#delete convenience self-instantiating shortcut
87 88 89 90 |
# File 'lib/uu/os/content/row.rb', line 87 def self.delete(sheet_uri, row_id) session = UU::OS::Security::Session.current_session self.new(session).delete(sheet_uri, row_id) end |
.get_attributes(sheet_uri, row_id) ⇒ Object
#get_attributes convenience self-instantiating shortcut
123 124 125 126 |
# File 'lib/uu/os/content/row.rb', line 123 def self.get_attributes(sheet_uri, row_id) session = UU::OS::Security::Session.current_session self.new(session).get_attributes(sheet_uri, row_id) end |
.get_data(sheet_uri, row_id) ⇒ Object
#get_data convenience self-instantiating shortcut
176 177 178 179 |
# File 'lib/uu/os/content/row.rb', line 176 def self.get_data(sheet_uri, row_id) session = UU::OS::Security::Session.current_session self.new(session).get_data(sheet_uri, row_id) end |
.set_attributes(sheet_uri, row = nil) ⇒ Object
#set_attributes convinience self-instantiating shortcut
203 204 205 206 |
# File 'lib/uu/os/content/row.rb', line 203 def self.set_attributes(sheet_uri, row = nil) session = UU::OS::Security::Session.current_session self.new(session).set_attributes(sheet_uri, row) end |
.set_constraints(sheet_uri, constraints = nil) ⇒ Object
#set_constraints convenience self-instantiating shortcut
227 228 229 230 |
# File 'lib/uu/os/content/row.rb', line 227 def self.set_constraints(sheet_uri, constraints = nil) session = UU::OS::Security::Session.current_session self.new(session).set_constraints(sheet_uri , constraints) end |
Instance Method Details
#create(sheet_uri, row = nil) ⇒ String
Creates a new row in a given sheet. The row data and its position within the content can be specified.
63 64 65 66 |
# File 'lib/uu/os/content/row.rb', line 63 def create(sheet_uri, row = nil) res = @cmd.invoke("Row/create",sheet_uri,prepare_params(row)) return res end |
#delete(sheet_uri, row_id) ⇒ Object
Removes the given row from the structure of the content including its data. If last row in content is deleted, a new row with one empty column is created.
82 83 84 |
# File 'lib/uu/os/content/row.rb', line 82 def delete(sheet_uri, row_id) @cmd.invoke("Row/delete",sheet_uri, prepare_params(row_id)) end |
#get_attributes(sheet_uri, row_id) ⇒ Hash
Retrieves the attributes of the given row.
118 119 120 |
# File 'lib/uu/os/content/row.rb', line 118 def get_attributes(sheet_uri, row_id) transform(@cmd.invoke('Row/getAttributes', sheet_uri, prepare_params(row_id))) #, invocation_method: 'get') end |
#get_data(sheet_uri, row_id) ⇒ Array<Hash>
Retrieves the data of the given row in json format. The structure of the row data is returned, data of each component in row is not returned.
171 172 173 |
# File 'lib/uu/os/content/row.rb', line 171 def get_data(sheet_uri, row_id) transform(@cmd.invoke('Row/getData', sheet_uri, prepare_params(row_id))) #, invocation_method: 'get') end |
#set_attributes(sheet_uri, row = nil) ⇒ String
Updates basic attributes of the specified row.
196 197 198 199 200 |
# File 'lib/uu/os/content/row.rb', line 196 def set_attributes(sheet_uri,row = nil) res = @cmd.invoke('Row/setAttributes', sheet_uri, prepare_params(row)) return res end |
#set_constraints(sheet_uri, constraints = nil) ⇒ Object
Sets constraints on the row.
222 223 224 |
# File 'lib/uu/os/content/row.rb', line 222 def set_constraints(sheet_uri, constraints = nil) @cmd.invoke('Row/setConstraints', sheet_uri, prepare_params(constraints)) end |
#set_data(sheet_uri, data = nil) ⇒ Object
Modifies data structure of the given row. In case input data contains part that is already defined in the row (recognized by its id) it is updated, otherwise replaced.
268 269 270 |
# File 'lib/uu/os/content/row.rb', line 268 def set_data(sheet_uri, data = nil) @cmd.invoke('Row/setData', sheet_uri, prepare_params(data)) end |