Module: RGeo::Geos::CAPIGeometryMethods

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#as_textObject Also known as: to_s


45
46
47
48
49
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 45

def as_text
  str = _as_text
  str.force_encoding("US-ASCII") if str.respond_to?(:force_encoding)
  str
end

#encode_with(coder) ⇒ Object

Psych support


32
33
34
35
36
37
38
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 32

def encode_with(coder) # :nodoc:
  my_factory = factory
  coder["factory"] = my_factory
  str = my_factory.write_for_psych(self)
  str = str.encode("US-ASCII") if str.respond_to?(:encode)
  coder["wkt"] = str
end

#init_with(coder) ⇒ Object

:nodoc:


40
41
42
43
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 40

def init_with(coder) # :nodoc:
  obj = coder["factory"].read_for_psych(coder["wkt"])
  _steal(obj)
end

#inspectObject


14
15
16
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 14

def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)} #{as_text.inspect}>"
end

#marshal_dumpObject

Marshal support


20
21
22
23
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 20

def marshal_dump # :nodoc:
  my_factory = factory
  [my_factory, my_factory.write_for_marshal(self)]
end

#marshal_load(data_) ⇒ Object

:nodoc:


25
26
27
28
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 25

def marshal_load(data_) # :nodoc:
  obj = data_[0].read_for_marshal(data_[1])
  _steal(obj)
end