Class: Librarian::Config::HashSource

Inherits:
Source
  • Object
show all
Defined in:
lib/librarian/config/hash_source.rb

Constant Summary

Constants inherited from Source

Source::CONFIG_KEY_VALIDITY_PATTERN, Source::RAW_KEY_SUFFIX_VALIDITY_PATTERN

Instance Attribute Summary collapse

Attributes inherited from Source

#adapter_name

Instance Method Summary collapse

Methods inherited from Source

#[], #[]=, config_key_validity_pattern, #keys, raw_key_suffix_validity_pattern

Constructor Details

#initialize(adapter_name, options = { }) ⇒ HashSource

Returns a new instance of HashSource


10
11
12
13
14
15
# File 'lib/librarian/config/hash_source.rb', line 10

def initialize(adapter_name, options = { })
  super

  self.name = options.delete(:name) or raise ArgumentError, "must provide name"
  self.raw = options.delete(:raw) or raise ArgumentError, "must provide raw"
end

Instance Attribute Details

#nameObject

Returns the value of attribute name


7
8
9
# File 'lib/librarian/config/hash_source.rb', line 7

def name
  @name
end

#rawObject

Returns the value of attribute raw


7
8
9
# File 'lib/librarian/config/hash_source.rb', line 7

def raw
  @raw
end

Instance Method Details

#to_sObject


17
18
19
# File 'lib/librarian/config/hash_source.rb', line 17

def to_s
  name
end