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
16 17 18 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 16 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
24 25 26 27 28 29 30 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 24 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
20 21 22 |
# File 'lib/elastic_graph/schema_artifacts/runtime_metadata/params.rb', line 20 def self.load_params_hash(hash_of_hashes) hash_of_hashes.to_h { |name, hash| [name, from_hash(hash, name)] } end |