class Percolate::Facet::FixtureFacet
A facet for looking up entities based on a fixed attribute `Hash`.
Attributes
fixtures[RW]
Public Class Methods
new()
click to toggle source
# File lib/percolate/facet/fixture_facet.rb, line 24 def initialize @fixtures = {} end
Public Instance Methods
find(key)
click to toggle source
# File lib/percolate/facet/fixture_facet.rb, line 35 def find(key) @fixtures[key] end
merge(other)
click to toggle source
# File lib/percolate/facet/fixture_facet.rb, line 39 def merge(other) raise ArgumentError, "Please provide another #{self.class}" if !other.is_a?(FixtureFacet) merged = FixtureFacet.new merged.fixtures = @fixtures.merge(other.fixtures) merged end