Class: IRuby::Input::Widget

Inherits:
Erector::Widget
  • Object
show all
Defined in:
lib/iruby/input/widget.rb

Direct Known Subclasses

Cancel, InputForm, Label, Popup

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.builder(method, &block) ⇒ Object



11
12
13
14
15
# File 'lib/iruby/input/widget.rb', line 11

def self.builder method, &block
  Builder.instance_eval do
    define_method method, &block
  end
end

Instance Method Details

#contentObject



9
# File 'lib/iruby/input/widget.rb', line 9

def content; widget_html; end

#widget_cssObject



7
# File 'lib/iruby/input/widget.rb', line 7

def widget_css; end

#widget_displayObject



24
25
26
27
28
29
30
31
# File 'lib/iruby/input/widget.rb', line 24

def widget_display
  IRuby.display(IRuby.html(
    Erector.inline{ style raw(widget_css) }.to_html
  ))

  IRuby.display(IRuby.html(to_html))
  IRuby.display(IRuby.javascript(widget_js))
end

#widget_htmlObject



8
# File 'lib/iruby/input/widget.rb', line 8

def widget_html; end

#widget_join(method, *args) ⇒ Object



17
18
19
20
21
22
# File 'lib/iruby/input/widget.rb', line 17

def widget_join method, *args
  strings = args.map do |arg|
    arg.is_a?(String) ? arg : arg.send(method)
  end
  strings.uniq.join("\n")
end

#widget_jsObject



6
# File 'lib/iruby/input/widget.rb', line 6

def widget_js; end