Sha256: 235768dd4195e2169cf945dc4c742c94e93252b4549dc47265ebf8a92c78ab8c

Contents?: true

Size: 324 Bytes

Versions: 10

Compression:

Stored size: 324 Bytes

Contents

class Detour::DefinedGroup
  attr_reader :name
  alias :id :name

  def initialize(name, test)
    @name = name.to_s
    @test = test
  end

  def to_s
    name
  end

  def test(arg)
    @test.call(arg)
  end

  def self.by_type(type)
    Detour.config.defined_groups.fetch(type.to_s, {}).with_indifferent_access
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
detour-0.0.15 app/models/detour/defined_group.rb
detour-0.0.14 app/models/detour/defined_group.rb
detour-0.0.13 app/models/detour/defined_group.rb
detour-0.0.12 app/models/detour/defined_group.rb
detour-0.0.11 app/models/detour/defined_group.rb
detour-0.0.10 app/models/detour/defined_group.rb
detour-0.0.9 app/models/detour/defined_group.rb
detour-0.0.7 app/models/detour/defined_group.rb
detour-0.0.6 app/models/detour/defined_group.rb
detour-0.0.5 app/models/detour/defined_group.rb