Module: RGeo::Geos::CAPIGeometryMethods

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#as_textObject Also known as: to_s


81
82
83
84
85
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 81

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


67
68
69
70
71
72
73
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 67

def encode_with(coder_)  # :nodoc:
  factory_ = self.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:


75
76
77
78
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 75

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

#inspectObject


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

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

#marshal_dumpObject

Marshal support


54
55
56
57
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 54

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

#marshal_load(data_) ⇒ Object

:nodoc:


59
60
61
62
# File 'lib/rgeo/geos/capi_feature_classes.rb', line 59

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