Sha256: d43427eb20aec12f2531e054634eeb7fb192035de658350286e1b1d9a670b4f8

Contents?: true

Size: 392 Bytes

Versions: 2

Compression:

Stored size: 392 Bytes

Contents

module BikePOA
  module Helpers
    module ForceField
      def self.included(base)
        base.send :extend, ClassMethods
      end

      module ClassMethods
        def force_integer(field)
          class_eval do
            define_method("#{field}=".to_sym) do |value|
              self.[]=(field, Integer(value))
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bikepoa-tools-0.2.0 lib/bikepoa/helpers.rb
bikepoa-tools-0.1.0 lib/bikepoa/helpers.rb