Class: DTK::DSL::FileGenerator::ContentInput::Hash
- Inherits:
-
InputOutputCommon::Canonical::Hash
- Object
- Hash
- InputOutputCommon::Hash
- InputOutputCommon::Canonical::Hash
- DTK::DSL::FileGenerator::ContentInput::Hash
- Includes:
- Mixin
- Defined in:
- lib/dsl/file_generator/content_input/hash.rb
Instance Attribute Summary
Attributes included from Mixin
Instance Method Summary collapse
-
#initialize(*args) ⇒ Hash
constructor
A new instance of Hash.
-
#set(output_key, val, opts = {}) ⇒ Object
opts can have keys :tags :tag.
-
#val(output_key, opts = {}) ⇒ Object
opts can have keys :tag - tag to filter on.
Methods included from Mixin
#add_tags!, #add_tags?, #add_tags_to_obj?, #id_handle, #initialize_tags_and_id_handle!, #matches_tag_type?, #obj_has_tag_type?, #set_id_handle
Methods inherited from InputOutputCommon::Canonical::Hash
#remove_all_except!, #req, #set?
Constructor Details
#initialize(*args) ⇒ Hash
Returns a new instance of Hash.
24 25 26 27 |
# File 'lib/dsl/file_generator/content_input/hash.rb', line 24 def initialize(*args) super end |
Instance Method Details
#set(output_key, val, opts = {}) ⇒ Object
opts can have keys
:tags
:tag
32 33 34 35 36 37 |
# File 'lib/dsl/file_generator/content_input/hash.rb', line 32 def set(output_key, val, opts = {}) ret = super(output_key, val) = opts[:tag] || opts[:tags] (ret, ) unless .nil? ret end |
#val(output_key, opts = {}) ⇒ Object
opts can have keys
:tag - tag to filter on
41 42 43 44 45 46 47 |
# File 'lib/dsl/file_generator/content_input/hash.rb', line 41 def val(output_key, opts = {}) ret = super(output_key) if tag = opts[:tag] ret = nil unless obj_has_tag?(ret, tag) end ret end |