Module: RGeo::ImplHelper::BasicGeometryMethods

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#factoryObject

Returns the value of attribute factory


14
15
16
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 14

def factory
  @factory
end

Instance Method Details

#as_binaryObject


28
29
30
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 28

def as_binary
  @factory.generate_wkb(self)
end

#as_textObject


24
25
26
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 24

def as_text
  @factory.generate_wkt(self)
end

#encode_with(coder) ⇒ Object

:nodoc:


40
41
42
43
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 40

def encode_with(coder)  # :nodoc:
  coder["factory"] = @factory
  coder["wkt"] = @factory.psych_wkt_generator.generate(self)
end

#init_with(coder) ⇒ Object

:nodoc:


45
46
47
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 45

def init_with(coder) # :nodoc:
  copy_state_from(coder["factory"].psych_wkt_parser.parse(coder["wkt"]))
end

#inspectObject

:nodoc:


16
17
18
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 16

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

#marshal_dumpObject

:nodoc:


32
33
34
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 32

def marshal_dump # :nodoc:
  [@factory, @factory.marshal_wkb_generator.generate(self)]
end

#marshal_load(data) ⇒ Object

:nodoc:


36
37
38
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 36

def marshal_load(data)  # :nodoc:
  copy_state_from(data[0].marshal_wkb_parser.parse(data[1]))
end

#to_sObject

:nodoc:


20
21
22
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 20

def to_s # :nodoc:
  as_text
end