Class: Yinx::DownConfig
- Inherits:
-
Object
- Object
- Yinx::DownConfig
- Defined in:
- lib/yinx/down_config.rb
Defined Under Namespace
Classes: NullNoteStore
Instance Attribute Summary collapse
-
#note_store ⇒ Object
readonly
Returns the value of attribute note_store.
Instance Method Summary collapse
-
#initialize(note_st = NullNoteStore.new) ⇒ DownConfig
constructor
A new instance of DownConfig.
- #note_filters ⇒ Object
Constructor Details
#initialize(note_st = NullNoteStore.new) ⇒ DownConfig
Returns a new instance of DownConfig.
12 13 14 |
# File 'lib/yinx/down_config.rb', line 12 def initialize note_st = NullNoteStore.new @note_store = note_st end |
Instance Attribute Details
#note_store ⇒ Object (readonly)
Returns the value of attribute note_store.
4 5 6 |
# File 'lib/yinx/down_config.rb', line 4 def note_store @note_store end |
Instance Method Details
#note_filters ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/yinx/down_config.rb', line 33 def note_filters merged_filters_in_array = individual_filters.reduce do |merged, indv| merged.empty? ? indv : (indv.empty? ? merged : merged.product(indv)) end merged_filters_in_hash = if merged_filters_in_array.fetch(0){[]}.kind_of? Array merged_filters_in_array.map do |sub_arr| sub_arr.flatten.reduce do |merged, indv| merged.merge indv end end else merged_filters_in_array end end |