Sha256: e658761504cacbc138d28a4f70767db739f28bb67854c7e0ab3275e199585fc9

Contents?: true

Size: 559 Bytes

Versions: 13

Compression:

Stored size: 559 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_sym|
          constant = (constant_sym.is_a?(Symbol)) ? constant_sym.to_s : constant_sym
          unless %w[PointTarget CoordinateTarget Point MoveTo].include? constant
            sym = constant.to_s.gsub(/[A-Z]/) { |p| '_' + p.downcase }[1..-1].to_sym
            block.call(sym,constant)
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
savage-transform-1.3.0 lib/savage/direction_proxy.rb
text2path-0.0.2 lib/ext/savage/lib/savage/direction_proxy.rb
text2path-0.0.1 lib/ext/savage/lib/savage/direction_proxy.rb
savage-1.2.0 lib/savage/direction_proxy.rb
savage-1.1.8 lib/savage/direction_proxy.rb
savage-1.1.7 lib/savage/direction_proxy.rb
savage-1.1.6 lib/savage/direction_proxy.rb
savage-1.1.5 lib/savage/direction_proxy.rb
savage-1.1.4 lib/savage/direction_proxy.rb
savage-1.1.3 lib/savage/direction_proxy.rb
savage-1.1.2 lib/savage/direction_proxy.rb
savage-1.1.1 lib/savage/direction_proxy.rb
savage-1.1.0 lib/savage/direction_proxy.rb