Class: Consently::Configuration::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/consently/configuration.rb

Overview

A named bundle of tags. Same API as the top-level tag, which is what makes the block form read the way it does.

Instance Method Summary collapse

Constructor Details

#initializeScope

Returns a new instance of Scope.



136
137
138
# File 'lib/consently/configuration.rb', line 136

def initialize
  @tags = {}
end

Instance Method Details

#tag(key, **options) ⇒ Object



140
141
142
143
# File 'lib/consently/configuration.rb', line 140

def tag(key, **options)
  provider = Providers::Base.build(key, **options)
  @tags[provider.key] = provider
end

#tagsObject



145
146
147
# File 'lib/consently/configuration.rb', line 145

def tags
  @tags
end