Class: MatrixObject
- Inherits:
-
Object
- Object
- MatrixObject
- Includes:
- DataFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/matrix.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
Returns the value of attribute cells.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#description ⇒ Object
Returns the value of attribute description.
-
#portfolio ⇒ Object
Returns the value of attribute portfolio.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
- #export ⇒ Object
-
#initialize(browser, opts = {}) ⇒ MatrixObject
constructor
A new instance of MatrixObject.
- #publish ⇒ Object
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ MatrixObject
Returns a new instance of MatrixObject.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 10 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :description=>random_alphanums, :columns=>[ {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color}, {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color}, {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color} ], :rows=>[ {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color}, {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color}, {:name=>random_alphanums, :bg_color=>random_hex_color, :font_color=>random_hex_color} ], :cells=>[] } = defaults.merge(opts) () requires @portfolio end |
Instance Attribute Details
#cells ⇒ Object
Returns the value of attribute cells.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def cells @cells end |
#columns ⇒ Object
Returns the value of attribute columns.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def columns @columns end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def description @description end |
#portfolio ⇒ Object
Returns the value of attribute portfolio.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def portfolio @portfolio end |
#rows ⇒ Object
Returns the value of attribute rows.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def rows @rows end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def status @status end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 8 def title @title end |
Instance Method Details
#create ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 34 def create open_my_site_by_name @portfolio matrices on Matrices do |list| list.add end on AddEditMatrix do |add| add.title.set @title # TODO Add filling in the non-essential fields. end @columns.each do |column| on AddEditMatrix do |add| add.add_column end on AddEditColumn do |add| add.name.set column[:name] add.background_color.set column[:bg_color] add.font_color.set column[:font_color] add.update end end @rows.each do |row| on AddEditMatrix do |add| add.add_row end on AddEditRow do |add| add.name.set row[:name] add.background_color.set row[:bg_color] add.font_color.set row[:font_color] add.update end end on AddEditMatrix do |add| add.save_changes end on EditMatrixCells do |matrix| matrix.return_to_list end end |
#delete ⇒ Object
85 86 87 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 85 def delete end |
#edit(opts = {}) ⇒ Object
76 77 78 79 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 76 def edit opts={} (opts) end |
#export ⇒ Object
93 94 95 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 93 def export end |
#publish ⇒ Object
89 90 91 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 89 def publish end |
#view ⇒ Object
81 82 83 |
# File 'lib/sambal-cle/data_objects/matrix.rb', line 81 def view end |