Module: RubyRemoteConfig::Repository

Included in:
FileRepository, GcpStorageRepository, WebRepository
Defined in:
lib/repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/repository.rb', line 5

def data
  @data
end

#lockObject (readonly)

Returns the value of attribute lock.



5
6
7
# File 'lib/repository.rb', line 5

def lock
  @lock
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/repository.rb', line 5

def name
  @name
end

Instance Method Details

#get_data(config_name) ⇒ Object

GetData returns the configuration data as a map of configuration names to their respective models.



18
19
20
21
22
23
# File 'lib/repository.rb', line 18

def get_data(config_name)
  @lock.synchronize do
    config = @data[config_name]
    return config
  end
end

#get_nameObject



13
14
15
# File 'lib/repository.rb', line 13

def get_name
  @name
end

#initialize(name:) ⇒ Object



7
8
9
10
11
# File 'lib/repository.rb', line 7

def initialize(name:)
  @name = name
  @data = {}
  @lock = Mutex.new
end

#refreshObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/repository.rb', line 25

def refresh
  raise NotImplementedError, 'Method not implemented'
end