Class: TopicObject
- Inherits:
-
Object
- Object
- TopicObject
- Includes:
- DataFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/forum.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#date_modified ⇒ Object
Returns the value of attribute date_modified.
-
#description ⇒ Object
Returns the value of attribute description.
-
#description_html ⇒ Object
Returns the value of attribute description_html.
-
#direct_link ⇒ Object
Returns the value of attribute direct_link.
-
#forum ⇒ Object
Returns the value of attribute forum.
-
#moderated ⇒ Object
Returns the value of attribute moderated.
-
#modified_by ⇒ Object
Returns the value of attribute modified_by.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#site ⇒ Object
Returns the value of attribute site.
-
#title ⇒ Object
(also: #name)
Returns the value of attribute title.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
- #get_entity_info ⇒ Object
-
#initialize(browser, opts = {}) ⇒ TopicObject
constructor
A new instance of TopicObject.
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ TopicObject
Returns a new instance of TopicObject.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 109 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :short_description=>random_alphanums, :description=>random_alphanums, } = defaults.merge(opts) () requires @site, @forum end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def @author end |
#date_created ⇒ Object
Returns the value of attribute date_created.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def date_created @date_created end |
#date_modified ⇒ Object
Returns the value of attribute date_modified.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def date_modified @date_modified end |
#description ⇒ Object
Returns the value of attribute description.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def description @description end |
#description_html ⇒ Object
Returns the value of attribute description_html.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def description_html @description_html end |
#direct_link ⇒ Object
Returns the value of attribute direct_link.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def direct_link @direct_link end |
#forum ⇒ Object
Returns the value of attribute forum.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def forum @forum end |
#moderated ⇒ Object
Returns the value of attribute moderated.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def moderated @moderated end |
#modified_by ⇒ Object
Returns the value of attribute modified_by.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def modified_by @modified_by end |
#short_description ⇒ Object
Returns the value of attribute short_description.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def short_description @short_description end |
#site ⇒ Object
Returns the value of attribute site.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def site @site end |
#title ⇒ Object Also known as: name
Returns the value of attribute title.
105 106 107 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 105 def title @title end |
Instance Method Details
#create ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 126 def create open_my_site_by_name @site forums on Forums do |forums| forums.new_topic_for_forum @forum end on AddEditTopic do |add| add.title.set @title add.short_description.set @short_description add.enter_source_text add.editor, @description add.save end end |
#delete ⇒ Object
172 173 174 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 172 def delete end |
#edit(opts = {}) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 140 def edit opts={} open_my_site_by_name @site forums on Forums do |forum| reset forum.topic_settings @title end on AddEditTopic do |edit| edit.title.fit opts[:title] edit.short_description.fit opts[:short_description] unless opts[:description] == nil edit.enter_source_text edit.editor, opts[:description] end edit.save end (opts) end |
#get_entity_info ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 176 def get_entity_info open_my_site_by_name @site forums on Forums do |forums| forums.topic_settings @title end on AddEditTopic do |topic| topic.entity_picker topic.editor end on EntityPicker do |picker| picker.view_topic_details @forum, @title @author = picker. @moderated = picker.moderated @modified_by = picker.modified_by @date_modified = picker.date_modified @date_created = picker.date_created @direct_link = picker.direct_link picker.close_picker end on AddEditTopic do |topic| topic.cancel end end |
#view ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/sambal-cle/data_objects/forum.rb', line 158 def view open_my_site_by_name @site forums on Forums do |forum| reset forum.open_topic @title end on ForumView do |view| @short_description = view.short_description view.view_full_description @description_html = view.description_html end end |