Class: Quby::Answers::Services::FiltersAnswerValue

Inherits:
Object
  • Object
show all
Defined in:
lib/quby/answers/services/filters_answer_value.rb

Instance Method Summary collapse

Constructor Details

#initialize(questionnaire) ⇒ FiltersAnswerValue

Returns a new instance of FiltersAnswerValue.



7
8
9
# File 'lib/quby/answers/services/filters_answer_value.rb', line 7

def initialize(questionnaire)
  @questionnaire = questionnaire
end

Instance Method Details

#filter(attributes) ⇒ Object



11
12
13
14
15
# File 'lib/quby/answers/services/filters_answer_value.rb', line 11

def filter(attributes)
  valid_attribute_keys.each_with_object({}) do |key, obj|
    obj[key] = attributes.fetch(key, nil)
  end
end