Sha256: c9a442b2b024f06d3001e209a55add635bec863912c9f99e752aaab2be4c5d34

Contents?: true

Size: 309 Bytes

Versions: 4

Compression:

Stored size: 309 Bytes

Contents

module WepayRails
  module Helpers
    module ModelHelpers
      def wepayable(*args)
        @params = args.last if args.last.is_a?(Hash)
        @column = args.first.to_s

        class_eval{
          "def has_#{@column}?
            #{@column}.present?
          end"
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wepay-rails-0.1.4 lib/helpers/model_helpers.rb
wepay-rails-0.1.3 lib/helpers/model_helpers.rb
wepay-rails-0.1.2 lib/helpers/model_helpers.rb
wepay-rails-0.1.1 lib/helpers/model_helpers.rb