Sha256: 95cbf52507e5c50cf6269810ae4061a9a9e146091b9d736ad32fa0be98d2ece1

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

module FilterParam
  class Scope
    attr_reader :name

    def initialize(name, options = {})
      @name = name
      @rename = scope_rename(options[:rename])
    end

    def actual_name
      rename.presence || name
    end

    private

    attr_reader :rename

    def scope_rename(rename)
      return rename.call(name) if rename.is_a?(Proc)

      rename
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
filter_param-0.1.2 lib/filter_param/scope.rb