Module: RGeo::Geos::CAPIGeometryMethods
- Includes:
- Feature::Instance
- Included in:
- CAPIGeometryCollectionImpl, CAPIGeometryImpl, CAPILineImpl, CAPILineStringImpl, CAPILinearRingImpl, CAPIMultiLineStringImpl, CAPIMultiPointImpl, CAPIMultiPolygonImpl, CAPIPointImpl, CAPIPolygonImpl
- Defined in:
- lib/rgeo/geos/capi_feature_classes.rb
Overview
:nodoc:
Instance Method Summary collapse
- #as_text ⇒ Object (also: #to_s)
-
#encode_with(coder_) ⇒ Object
Psych support.
-
#init_with(coder_) ⇒ Object
:nodoc:.
- #inspect ⇒ Object
-
#marshal_dump ⇒ Object
Marshal support.
-
#marshal_load(data_) ⇒ Object
:nodoc:.
Instance Method Details
#as_text ⇒ Object 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 |
#inspect ⇒ Object
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_dump ⇒ Object
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 |