class DashOverlord::UseCases::V1::Videos::Index::Postgres::GetFilters

Public Instance Methods

hhc() click to toggle source
# File lib/dash_overlord/use_cases/v1/videos/index/postgres/get_filters.rb, line 19
def hhc
  JSON.parse(File.read(File.expand_path('../hhc.json', __FILE__)))
end
laundry() click to toggle source
# File lib/dash_overlord/use_cases/v1/videos/index/postgres/get_filters.rb, line 23
def laundry
  {
    filters: [
      {
        name: 'country',
        title: 'Country',
        options: [
          { value: 'South Africa', label: 'South Africa' },
          { value: 'Nigeria', label: 'Nigeria' },
          { value: 'Kenya', label: 'Kenya' }
        ]
      },
      {
        name: 'category',
        title: 'Category',
        options:[
          { value: 'Brands', label: 'Brands' },
          { value: 'Laundry', label: 'Laundry' },
          { value: 'Doing Laundry', label: 'Doing Laundry' }
        ]
      }
    ]
  }
end
perform() click to toggle source
# File lib/dash_overlord/use_cases/v1/videos/index/postgres/get_filters.rb, line 9
def perform
  filters = {
    'hhc' => hhc,
    'laundry' => laundry,
    'world_cuisine' => world_cuisine
  }

  context.meta.assign_attributes filters[context.segment_uid] || {}
end
world_cuisine() click to toggle source
# File lib/dash_overlord/use_cases/v1/videos/index/postgres/get_filters.rb, line 48
def world_cuisine
  {
    filters: [
      {
        name: 'country',
        title: 'Country',
        options: [
          { value: 'South Africa', label: 'South Africa' },
          { value: 'India', label: 'India' },
          { value: 'Brazil', label: 'Brazil' }
        ]
      },
      {
        name: 'category',
        title: 'Category',
        options:[
          { value: 'Serving', label: 'Serving' },
          { value: 'Cooking', label: 'Cooking' },
          { value: 'Pre-cooking', label: 'Pre-cooking' }
        ]
      },
      {
        name: 'cuisine',
        title: 'Cuisine',
        options:[
          { value: 'Chinese', label: 'Chinese' },
          { value: 'Italian', label: 'Italian' },
          { value: 'Thai', label: 'Thai' },
          { value: 'Indian', label: 'Indian' }
        ]
      }
    ]
  }
end