class RGeo::Feature::MixinCollection::TypeData

An API point controlling a particular type.

Attributes

collection[R]

The MixinCollection owning this data

type[R]

The feature type

Public Instance Methods

add(module_) click to toggle source

Add a mixin to be included in implementations of this type.

# File lib/rgeo/feature/mixins.rb, line 97
def add(module_)
  @mixins << module_
  @classes.each{ |k_| k_.class_eval{ include(module_) } }
  _radd(module_)
end
include_in_class(klass_, include_ancestry_=false) click to toggle source

A class that implements this type should call this method to get the appropriate mixins. If include_ancestry_ is set to true, then mixins connected to subtypes of this type are also added to the class.

# File lib/rgeo/feature/mixins.rb, line 109
def include_in_class(klass_, include_ancestry_=false)
  (include_ancestry_ ? @rmixins : @mixins).each{ |m_| klass_.class_eval{ include(m_) } }
  (include_ancestry_ ? @rclasses : @classes) << klass_
  self
end
include_in_object(obj_, include_ancestry_=false) click to toggle source

An object that implements this type should call this method to get the appropriate mixins. If include_ancestry_ is set to true, then mixins connected to subtypes of this type are also added to the object.

# File lib/rgeo/feature/mixins.rb, line 121
def include_in_object(obj_, include_ancestry_=false)
  (include_ancestry_ ? @rmixins : @mixins).each{ |m_| obj_.extend(m_) }
  self
end