11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/semian/adapter.rb', line 11
def semian_resource
return @semian_resource if @semian_resource
case semian_options
when false
@semian_resource = UnprotectedResource.new(semian_identifier)
when nil
Semian.logger.info("Semian is not configured for #{self.class.name}: #{semian_identifier}")
@semian_resource = UnprotectedResource.new(semian_identifier)
else
options = semian_options.dup
options.delete(:name)
options[:consumer] = self
options[:exceptions] ||= []
options[:exceptions] += resource_exceptions
resource = ::Semian.retrieve_or_register(semian_identifier, **options)
@semian_resource = resource unless options.fetch(:dynamic, false)
resource
end
end
|