Class: Valkyrie::Config
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Valkyrie::Config
- Defined in:
- lib/valkyrie.rb
Instance Method Summary collapse
- #auto_cast_iso8601_as_datetime ⇒ Object
- #index_tsim_only_threshold ⇒ Object
-
#initialize(hsh = {}) ⇒ Config
constructor
Method lookup with OpenStruct appears to have issues in Ruby 3, so we unfortunately can’t just call
super
when accessing values in the following methods. - #metadata_adapter ⇒ Object
-
#resource_class_resolver ⇒ #call
The returned anonymous method (e.g. responds to #call) has a signature of an unamed parameter that is a string.
- #storage_adapter ⇒ Object
Constructor Details
#initialize(hsh = {}) ⇒ Config
Method lookup with OpenStruct appears to have issues in Ruby 3, so we unfortunately can’t just call super
when accessing values in the following methods. Using brackets works fine, though.
88 89 90 |
# File 'lib/valkyrie.rb', line 88 def initialize(hsh = {}) super(defaults.merge(hsh)) end |
Instance Method Details
#auto_cast_iso8601_as_datetime ⇒ Object
104 105 106 |
# File 'lib/valkyrie.rb', line 104 def auto_cast_iso8601_as_datetime self[:auto_cast_iso8601_as_datetime] end |
#index_tsim_only_threshold ⇒ Object
100 101 102 |
# File 'lib/valkyrie.rb', line 100 def index_tsim_only_threshold self[:index_tsim_only_threshold].to_i end |
#metadata_adapter ⇒ Object
92 93 94 |
# File 'lib/valkyrie.rb', line 92 def Valkyrie::MetadataAdapter.find(self[:metadata_adapter].to_sym) end |
#resource_class_resolver ⇒ #call
The returned anonymous method (e.g. responds to #call) has a signature of an unamed parameter that is a string. Calling the anonymous method should return a Valkyrie::Resource from which Valkyrie will map the persisted data into.
118 119 120 |
# File 'lib/valkyrie.rb', line 118 def resource_class_resolver self[:resource_class_resolver] end |
#storage_adapter ⇒ Object
96 97 98 |
# File 'lib/valkyrie.rb', line 96 def storage_adapter Valkyrie::StorageAdapter.find(self[:storage_adapter].to_sym) end |