Module: RGeo::ImplHelper::BasicGeometryMethods

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#_copy_state_from(obj_) ⇒ Object

:nodoc:


80
81
82
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 80

def _copy_state_from(obj_)  # :nodoc:
  @factory = obj_.factory
end

#_set_factory(factory_) ⇒ Object

:nodoc:


60
61
62
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 60

def _set_factory(factory_)  # :nodoc:
  @factory = factory_
end

#_validate_geometryObject

:nodoc:


56
57
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 56

def _validate_geometry  # :nodoc:
end

#as_binaryObject


75
76
77
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 75

def as_binary
  @factory._generate_wkb(self)
end

#as_textObject


70
71
72
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 70

def as_text
  @factory._generate_wkt(self)
end

#encode_with(coder_) ⇒ Object

:nodoc:


94
95
96
97
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 94

def encode_with(coder_)  # :nodoc:
  coder_['factory'] = @factory
  coder_['wkt'] = @factory._psych_wkt_generator.generate(self)
end

#factoryObject


65
66
67
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 65

def factory
  @factory
end

#init_with(coder_) ⇒ Object

:nodoc:


99
100
101
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 99

def init_with(coder_)  # :nodoc:
  _copy_state_from(coder_['factory']._psych_wkt_parser.parse(coder_['wkt']))
end

#inspectObject

:nodoc:


47
48
49
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 47

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

#marshal_dumpObject

:nodoc:


85
86
87
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 85

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

#marshal_load(data_) ⇒ Object

:nodoc:


89
90
91
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 89

def marshal_load(data_)  # :nodoc:
  _copy_state_from(data_[0]._marshal_wkb_parser.parse(data_[1]))
end

#to_sObject

:nodoc:


51
52
53
# File 'lib/rgeo/impl_helper/basic_geometry_methods.rb', line 51

def to_s  # :nodoc:
  as_text
end