Class: HtmlCom::MindWordsWidget
- Inherits:
-
Object
- Object
- HtmlCom::MindWordsWidget
- Defined in:
- lib/htmlcom.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ MindWordsWidget
constructor
A new instance of MindWordsWidget.
- #input(params = {}) ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(attributes) ⇒ MindWordsWidget
Returns a new instance of MindWordsWidget.
299 300 301 302 303 304 305 306 307 |
# File 'lib/htmlcom.rb', line 299 def initialize(attributes) @attributes = { content: '', action: 'mwupdate', target: 'icontent' }.merge(attributes) end |
Instance Method Details
#input(params = {}) ⇒ Object
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/htmlcom.rb', line 309 def input(params={}) h = @attributes.merge(params) content = h[:content] action = h[:action] target = h[:target] @html =<<EOF <form action='#{action}' method='post' target='#{target}'> <textarea name='content' cols='30' rows='19'> #{content} </textarea> <input type='submit' value='Submit'/> </form> EOF self end |
#to_html ⇒ Object
328 329 330 |
# File 'lib/htmlcom.rb', line 328 def to_html() @html end |