Class: GlossaryTermObject
- Inherits:
-
Object
- Object
- GlossaryTermObject
- Includes:
- DataFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/glossary_term.rb
Instance Attribute Summary collapse
-
#long_description ⇒ Object
Returns the value of attribute long_description.
-
#portfolio ⇒ Object
Returns the value of attribute portfolio.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ GlossaryTermObject
constructor
A new instance of GlossaryTermObject.
- #open ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ GlossaryTermObject
Returns a new instance of GlossaryTermObject.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 10 def initialize(browser, opts={}) @browser = browser defaults = { :term=>random_alphanums, :short_description=>random_alphanums, :long_description=>random_alphanums } = defaults.merge(opts) () requires @portfolio end |
Instance Attribute Details
#long_description ⇒ Object
Returns the value of attribute long_description.
8 9 10 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 8 def long_description @long_description end |
#portfolio ⇒ Object
Returns the value of attribute portfolio.
8 9 10 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 8 def portfolio @portfolio end |
#short_description ⇒ Object
Returns the value of attribute short_description.
8 9 10 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 8 def short_description @short_description end |
#term ⇒ Object
Returns the value of attribute term.
8 9 10 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 8 def term @term end |
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 24 def create open_my_site_by_name @portfolio glossary on Glossary do |list| list.add end on AddEditTerm do |term| term.term.set @term term.short_description.set @short_description term.long_description=@long_description term.add_term end end |
#delete ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 61 def delete open_my_site_by_name @portfolio glossary on Glossary do |list| list.delete @term end end |
#edit(opts = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 38 def edit opts={} open_my_site_by_name @portfolio glossary on Glossary do |list| list.edit @term end on AddEditTerm do |term| term.term.fit opts[:term] term.short_description.fit opts[:short_description] term.long_description=opts[:long_description] unless opts[:long_description]==nil term.save_changes end (opts) end |
#open ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/sambal-cle/data_objects/glossary_term.rb', line 53 def open open_my_site_by_name @portfolio glossary on Glossary do |list| list.open @term end end |