Method: GoodData::ReportDefinition.create_filters_part
- Defined in:
- lib/gooddata/models/metadata/report_definition.rb
.create_filters_part(filters, options = {}) ⇒ Array<Hash>
Method creates the list of filter representaion suitable for posting on the api. It can currently recognize 2 types of filters. Variable filters and attribute filters. Method for internal usage.
63 64 65 66 67 68 |
# File 'lib/gooddata/models/metadata/report_definition.rb', line 63 def create_filters_part(filters, = {}) project = [:project] vars = filters.select { |f| f.is_a?(GoodData::Variable) }.map { |v| { expression: "[#{v.uri}]" } } category = filters.select { |f| f.is_a?(Array) }.map { |v| GoodData::SmallGoodZilla.create_category_filter(v, project) } vars + category end |