Class: Rokaki::FilterModel::LikeKeys
- Inherits:
-
Object
- Object
- Rokaki::FilterModel::LikeKeys
- Defined in:
- lib/rokaki/filter_model/like_keys.rb
Overview
Converts deep hashes into keys effectively drops the leaf values and make’s their keys the leaves
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#key_paths ⇒ Object
readonly
Returns the value of attribute key_paths.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args) ⇒ LikeKeys
constructor
A new instance of LikeKeys.
Constructor Details
#initialize(args) ⇒ LikeKeys
Returns a new instance of LikeKeys.
10 11 12 13 14 |
# File 'lib/rokaki/filter_model/like_keys.rb', line 10 def initialize(args) @args = args @keys = [] @key_paths = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
16 17 18 |
# File 'lib/rokaki/filter_model/like_keys.rb', line 16 def args @args end |
#key_paths ⇒ Object (readonly)
Returns the value of attribute key_paths.
16 17 18 |
# File 'lib/rokaki/filter_model/like_keys.rb', line 16 def key_paths @key_paths end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
16 17 18 |
# File 'lib/rokaki/filter_model/like_keys.rb', line 16 def keys @keys end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rokaki/filter_model/like_keys.rb', line 18 def call args.keys.each do |key| map_keys(key: key, value: args[key]) end keys end |