Method: Vips::Yard.gtype_to_ruby

Defined in:
lib/vips/image.rb

.gtype_to_ruby(gtype) ⇒ Object

turn a gtype into a ruby type name

[View source]

1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
# File 'lib/vips/image.rb', line 1662

def self.gtype_to_ruby gtype
  fundamental = GObject.g_type_fundamental gtype
  type_name = GObject.g_type_name gtype

  if MAP_GO_TO_RUBY.include? type_name
    type_name = MAP_GO_TO_RUBY[type_name]
  end

  if fundamental == GObject::GFLAGS_TYPE ||
      fundamental == GObject::GENUM_TYPE
    type_name = "Vips::" + type_name[/Vips(.*)/, 1]
  end

  type_name
end