Class: Mirah::JavaSource::JsniMethodBuilder
- Inherits:
-
MethodBuilder
- Object
- MethodBuilder
- Mirah::JavaSource::JsniMethodBuilder
- Includes:
- Helper
- Defined in:
- lib/mirah/plugin/gwt.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#out ⇒ Object
Returns the value of attribute out.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from MethodBuilder
Instance Method Summary collapse
-
#initialize(cls, options) ⇒ JsniMethodBuilder
constructor
A new instance of JsniMethodBuilder.
-
#start ⇒ Object
Based on superclass’s method.
-
#stop ⇒ Object
Based on superclass’s method.
Methods included from Helper
#annotate, #annotation_value, #block, #dedent, #indent, #init_value, #print, #puts
Methods inherited from MethodBuilder
#declare_local, #instanceof, #label, #ldc_class, #ldc_double, #ldc_float, #ldc_long, #local?, #method_missing, #push_int, #returns_void?, #tmp
Constructor Details
#initialize(cls, options) ⇒ JsniMethodBuilder
Returns a new instance of JsniMethodBuilder.
39 40 41 |
# File 'lib/mirah/plugin/gwt.rb', line 39 def initialize(cls, ) super(cls, ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mirah::JavaSource::MethodBuilder
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
37 38 39 |
# File 'lib/mirah/plugin/gwt.rb', line 37 def name @name end |
#out ⇒ Object
Returns the value of attribute out.
37 38 39 |
# File 'lib/mirah/plugin/gwt.rb', line 37 def out @out end |
#type ⇒ Object
Returns the value of attribute type.
37 38 39 |
# File 'lib/mirah/plugin/gwt.rb', line 37 def type @type end |
Instance Method Details
#start ⇒ Object
Based on superclass’s method.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/mirah/plugin/gwt.rb', line 44 def start print "public#{@static} native #{@typename} #{@name}(" @args.each_with_index do |(type, name), i| print ', ' unless i == 0 print "#{type.to_source} #{name}" end print ')' unless @exceptions.empty? print ' throws ' @exceptions.each_with_index do |exception, i| print ', ' unless i == 0 print exception.name end end puts ' /*-{' end |
#stop ⇒ Object
Based on superclass’s method.
62 63 64 |
# File 'lib/mirah/plugin/gwt.rb', line 62 def stop puts '}-*/;' end |