Class: GObjectIntrospection::CallableInfo
- Inherits:
-
Object
- Object
- GObjectIntrospection::CallableInfo
- Extended by:
- CollectionReader
- Defined in:
- lib/gobject-introspection/callable-info.rb
Instance Method Summary collapse
- #description ⇒ Object
- #have_return_value? ⇒ Boolean
- #in_args ⇒ Object
- #inspect ⇒ Object
- #n_in_args ⇒ Object
- #n_out_args ⇒ Object
- #n_required_in_args ⇒ Object
- #out_args ⇒ Object
- #require_callback? ⇒ Boolean
- #required_in_args ⇒ Object
- #signature ⇒ Object
Methods included from CollectionReader
Instance Method Details
#description ⇒ Object
68 69 70 |
# File 'lib/gobject-introspection/callable-info.rb', line 68 def description signature end |
#have_return_value? ⇒ Boolean
62 63 64 65 66 |
# File 'lib/gobject-introspection/callable-info.rb', line 62 def have_return_value? return true if return_type.tag != TypeTag::VOID return true if return_type.pointer? not n_out_args.zero? end |
#in_args ⇒ Object
25 26 27 |
# File 'lib/gobject-introspection/callable-info.rb', line 25 def in_args @in_args ||= compute_in_args end |
#inspect ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/gobject-introspection/callable-info.rb', line 77 def inspect super.gsub(/>\z/) do " signature=<#{signature}>" + " name=#{name.inspect}" + " arguments=#{args.inspect}" + " return_type=#{return_type.inspect}" + " may_return_type_null=#{may_return_null?.inspect}>" end end |
#n_in_args ⇒ Object
35 36 37 |
# File 'lib/gobject-introspection/callable-info.rb', line 35 def n_in_args in_args.size end |
#n_out_args ⇒ Object
58 59 60 |
# File 'lib/gobject-introspection/callable-info.rb', line 58 def n_out_args out_args.size end |
#n_required_in_args ⇒ Object
39 40 41 |
# File 'lib/gobject-introspection/callable-info.rb', line 39 def n_required_in_args required_in_args.size end |
#out_args ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gobject-introspection/callable-info.rb', line 47 def out_args @out_args ||= args.find_all do |arg| case arg.direction when Direction::OUT, Direction::INOUT true else false end end end |
#require_callback? ⇒ Boolean
43 44 45 |
# File 'lib/gobject-introspection/callable-info.rb', line 43 def require_callback? (@require_callback ||= compute_require_callback) == :required end |
#required_in_args ⇒ Object
29 30 31 32 33 |
# File 'lib/gobject-introspection/callable-info.rb', line 29 def required_in_args @required_in_args ||= in_args.reject do |arg| arg.may_be_null? end end |
#signature ⇒ Object
72 73 74 75 |
# File 'lib/gobject-introspection/callable-info.rb', line 72 def signature argument_signatures = args.collect(&:signature).join(", ") "#{name}(#{argument_signatures}): #{return_type.description}" end |