Class: SearchableBy::Profiles

Inherits:
Object
  • Object
show all
Defined in:
lib/searchable_by/profiles.rb

Instance Method Summary collapse

Constructor Details

#initializeProfiles

Returns a new instance of Profiles.



3
4
5
# File 'lib/searchable_by/profiles.rb', line 3

def initialize
  @profiles = {}
end

Instance Method Details

#[](name) ⇒ Object



7
8
9
10
# File 'lib/searchable_by/profiles.rb', line 7

def [](name)
  name = name.to_sym
  @profiles[name] ||= Config.new
end

#each(&block) ⇒ Object



12
13
14
# File 'lib/searchable_by/profiles.rb', line 12

def each(&block)
  @profiles.each(&block)
end

#initialize_copy(other) ⇒ Object



16
17
18
19
20
21
# File 'lib/searchable_by/profiles.rb', line 16

def initialize_copy(other)
  @profiles = {}
  other.each do |name, config|
    @profiles[name] = config.dup
  end
end