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