module Shaf::Profiles

Public Class Methods

clear() click to toggle source
# File lib/shaf/profiles.rb, line 36
def clear
  @profiles.clear
end
find(name) click to toggle source
# File lib/shaf/profiles.rb, line 21
def find(name)
  name = String(name)
  return if name.empty?

  profiles.find { |profile| profile.match? name }
end
find!(name) click to toggle source
# File lib/shaf/profiles.rb, line 28
def find!(name)
  find(name) or raise ProfileNotFoundError, name
end
profiles() click to toggle source
# File lib/shaf/profiles.rb, line 32
def profiles
  @profiles ||= []
end
register(clazz) click to toggle source
# File lib/shaf/profiles.rb, line 13
def register(clazz)
  profiles << clazz
end
unregister(clazz) click to toggle source
# File lib/shaf/profiles.rb, line 17
def unregister(clazz)
  profiles.delete(clazz)
end