Class: UU::OS::Content::Column
- Inherits:
-
ContentClient
- Object
- ContentClient
- UU::OS::Content::Column
- Defined in:
- lib/uu/os/content/column.rb
Class Method Summary collapse
-
.create(sheet_uri, dto = nil) ⇒ Object
#create convenience self-instantiating shortcut.
-
.delete(sheet_uri, column_id) ⇒ Object
#delete convinience self-instantiating shortcut.
-
.get_attributes(sheet_uri, column_id) ⇒ Object
#get_attributes convenience self-instantiating shortcut.
-
.get_data(sheet_uri, column_id) ⇒ Object
#get_data convinience self-instantiating shortcut.
-
.set_attributes(sheet_uri, column = 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 convinience self-instantiating shortcut.
Instance Method Summary collapse
-
#create(sheet_uri, column = nil) ⇒ String
Creates a new column in a given row.
-
#delete(sheet_uri, column_id) ⇒ Object
Removes the given column from the content structure including its data.
-
#get_attributes(sheet_uri, column_id) ⇒ Hash
Retrieves the attributes of the given column.
-
#get_data(sheet_uri, column_id) ⇒ Hash
Retrieves the data of the given column in json format.
-
#initialize(session) ⇒ Column
constructor
Creates a new instance of
Column
. -
#set_attributes(sheet_uri, column = nil) ⇒ String
Updates basic attributes of the specified column.
-
#set_constraints(sheet_uri, constraints = nil) ⇒ Object
Sets constraints on the column.
-
#set_data(sheet_uri, data = nil) ⇒ Object
Modifies data structure of the given column.
Constructor Details
Class Method Details
.create(sheet_uri, dto = nil) ⇒ Object
#create convenience self-instantiating shortcut
60 61 62 63 |
# File 'lib/uu/os/content/column.rb', line 60 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, column_id) ⇒ Object
#delete convinience self-instantiating shortcut
79 80 81 82 |
# File 'lib/uu/os/content/column.rb', line 79 def self.delete(sheet_uri, column_id) session = UU::OS::Security::Session.current_session self.new(session).delete(sheet_uri, column_id) end |
.get_attributes(sheet_uri, column_id) ⇒ Object
#get_attributes convenience self-instantiating shortcut
114 115 116 117 |
# File 'lib/uu/os/content/column.rb', line 114 def self.get_attributes(sheet_uri, column_id) session = UU::OS::Security::Session.current_session self.new(session).get_attributes(sheet_uri, column_id) end |
.get_data(sheet_uri, column_id) ⇒ Object
#get_data convinience self-instantiating shortcut
152 153 154 155 |
# File 'lib/uu/os/content/column.rb', line 152 def self.get_data(sheet_uri, column_id) session = UU::OS::Security::Session.current_session self.new(session).get_data(sheet_uri, column_id) end |
.set_attributes(sheet_uri, column = nil) ⇒ Object
#set_attributes convinience self-instantiating shortcut
177 178 179 180 |
# File 'lib/uu/os/content/column.rb', line 177 def self.set_attributes(sheet_uri, column = nil) session = UU::OS::Security::Session.current_session self.new(session).set_attributes(sheet_uri, column) end |
.set_constraints(sheet_uri, constraints = nil) ⇒ Object
#set_constraints convenience self-instantiating shortcut
201 202 203 204 |
# File 'lib/uu/os/content/column.rb', line 201 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, column = nil) ⇒ String
Creates a new column in a given row. The column data structure can be specified.
54 55 56 57 |
# File 'lib/uu/os/content/column.rb', line 54 def create(sheet_uri, column = nil) res = @cmd.invoke("Column/create",sheet_uri,prepare_params(column)) return res end |
#delete(sheet_uri, column_id) ⇒ Object
Removes the given column from the content structure including its data. If last column in row is deleted, a new empty column is created in the row.
74 75 76 |
# File 'lib/uu/os/content/column.rb', line 74 def delete(sheet_uri, column_id) @cmd.invoke("Column/delete",sheet_uri, prepare_params(column_id)) end |
#get_attributes(sheet_uri, column_id) ⇒ Hash
Retrieves the attributes of the given column.
109 110 111 |
# File 'lib/uu/os/content/column.rb', line 109 def get_attributes(sheet_uri, column_id) transform(@cmd.invoke('Column/getAttributes', sheet_uri, prepare_params(column_id))) #, invocation_method: 'get') end |
#get_data(sheet_uri, column_id) ⇒ Hash
Retrieves the data of the given column in json format. The data of each component in content is not returned.
147 148 149 |
# File 'lib/uu/os/content/column.rb', line 147 def get_data(sheet_uri, column_id) transform(@cmd.invoke('Column/getData', sheet_uri, prepare_params(column_id))) #, invocation_method: 'get') end |
#set_attributes(sheet_uri, column = nil) ⇒ String
Updates basic attributes of the specified column.
171 172 173 174 |
# File 'lib/uu/os/content/column.rb', line 171 def set_attributes(sheet_uri, column = nil) res = @cmd.invoke('Column/setAttributes', sheet_uri, prepare_params(column)) return res end |
#set_constraints(sheet_uri, constraints = nil) ⇒ Object
Sets constraints on the column.
196 197 198 |
# File 'lib/uu/os/content/column.rb', line 196 def set_constraints(sheet_uri, constraints = nil) @cmd.invoke('Column/setConstraints', sheet_uri, prepare_params(constraints)) end |
#set_data(sheet_uri, data = nil) ⇒ Object
Modifies data structure of the given column. In case input data contains part that is already defined in the column (recognized by its id) it is updated, otherwise replaced.
228 229 230 |
# File 'lib/uu/os/content/column.rb', line 228 def set_data(sheet_uri, data = nil) @cmd.invoke('Column/setData', sheet_uri, prepare_params(data)) end |