Module: ElasticGraph::SchemaArtifacts::RuntimeMetadata::Param
- Defined in:
- lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb
Class Method Summary collapse
- .dump_params_hash(hash_of_params) ⇒ Object
- .from_hash(hash, name) ⇒ Object
- .load_params_hash(hash_of_hashes) ⇒ Object
Class Method Details
.dump_params_hash(hash_of_params) ⇒ Object
17 18 19 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 17 def self.dump_params_hash(hash_of_params) hash_of_params.sort_by(&:first).to_h { |name, param| [name, param.to_dumpable_hash(name)] } end |
.from_hash(hash, name) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 25 def self.from_hash(hash, name) if hash.key?(StaticParam::VALUE) StaticParam.from_hash(hash) else DynamicParam.from_hash(hash, name) end end |
.load_params_hash(hash_of_hashes) ⇒ Object
21 22 23 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 21 def self.load_params_hash(hash_of_hashes) hash_of_hashes.to_h { |name, hash| [name, from_hash(hash, name)] } end |