Sha256: 2e82c275381719b9188d328b64ef0e85029f913c4ff0aa61632ab788cf7ebc28

Contents?: true

Size: 472 Bytes

Versions: 5

Compression:

Stored size: 472 Bytes

Contents

module Savage
  module DirectionProxy
    def self.included(klass)  
      klass.extend ClassMethods  
    end
    
    module ClassMethods
      def define_proxies(&block)
        Directions.constants.each do |constant|
          unless %w[PointTarget CoordinateTarget Point MoveTo].include? constant
            sym = constant.gsub(/[A-Z]/) { |p| '_' + p.downcase }[1..-1].to_sym
            block.call(sym,constant)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
savage-1.0.3 lib/savage/direction_proxy.rb
savage-1.0.2 lib/savage/direction_proxy.rb
savage-1.0.1 lib/savage/direction_proxy.rb
savage-1.0.0 lib/savage/direction_proxy.rb
savage-0.2.0 lib/savage/direction_proxy.rb