Module: RGeo::Geos::CAPIGeometryMethods

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#as_textObject Also known as: to_s



43
44
45
46
47
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 43

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



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

def encode_with(coder_) # :nodoc:
  factory_ = factory
  coder_["factory"] = factory_
  str_ = factory_._write_for_psych(self)
  str_ = str_.encode("US-ASCII") if str_.respond_to?(:encode)
  coder_["wkt"] = str_
end

#init_with(coder_) ⇒ Object

:nodoc:



38
39
40
41
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 38

def init_with(coder_) # :nodoc:
  obj_ = coder_["factory"]._read_for_psych(coder_["wkt"])
  _steal(obj_)
end

#inspectObject



12
13
14
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 12

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

#marshal_dumpObject

Marshal support



18
19
20
21
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 18

def marshal_dump # :nodoc:
  factory_ = factory
  [factory_, factory_._write_for_marshal(self)]
end

#marshal_load(data_) ⇒ Object

:nodoc:



23
24
25
26
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 23

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