Sha256: 9c5b25bc448f7314586e30b12bd376805781f4270195ada6365050ca671e2425

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

require 'raisin/version_constraint'

module Raisin
  module Mapper
    def api(version, default: false)
      return unless block_given?

      version     = version.to_s
      raise 'Version is missing in constraint' if version.blank?
      constraint  = Raisin::VersionConstraint.new(version) unless default

      scope(module: version, constraints: constraint) do
        yield
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raisin-0.2.0 lib/raisin/mapper.rb