Sha256: a9788d7c30d4ea0d1b32260990a29ce1d671f7ecdaf82c80e4782da78e29ba22

Contents?: true

Size: 1.14 KB

Versions: 26

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true
require 'ostruct'
module Dummy
  module Data
    Cheese = Struct.new(:id, :flavor, :origin, :fat_content, :source) do
      def ==(other)
        # This is buggy on purpose -- it shouldn't be called during execution.
        other.id == id
      end

      # Alias for when this is treated as milk in EdibleAsMilkInterface
      def fatContent # rubocop:disable Naming/MethodName
        fat_content
      end
    end

    Milk = Struct.new(:id, :fat_content, :origin, :source, :flavors)
    Cow = Struct.new(:id, :name, :last_produced_dairy)
    Goat = Struct.new(:id, :name, :last_produced_dairy)
  end

  CHEESES = {
    1 => Data::Cheese.new(1, "Brie", "France", 0.19, 1),
    2 => Data::Cheese.new(2, "Gouda", "Netherlands", 0.3, 1),
    3 => Data::Cheese.new(3, "Manchego", "Spain", 0.065, "SHEEP")
  }

  MILKS = {
    1 => Data::Milk.new(1, 0.04, "Antiquity", 1, ["Natural", "Chocolate", "Strawberry"]),
  }

  DAIRY = OpenStruct.new(
    id: 1,
    cheese: CHEESES[1],
    milks: [MILKS[1]]
  )

  COWS = {
    1 => Data::Cow.new(1, "Billy", MILKS[1])
  }

  GOATS = {
    1 => Data::Goat.new(1, "Gilly", MILKS[1]),
  }
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/support/dummy/data.rb
graphql-1.9.11 spec/support/dummy/data.rb
graphql-1.9.10 spec/support/dummy/data.rb
graphql-1.9.9 spec/support/dummy/data.rb
graphql-1.9.8 spec/support/dummy/data.rb
graphql-1.9.7 spec/support/dummy/data.rb
graphql-1.9.6 spec/support/dummy/data.rb
graphql-1.9.5 spec/support/dummy/data.rb
graphql-1.9.4 spec/support/dummy/data.rb
graphql-1.9.3 spec/support/dummy/data.rb
graphql-1.9.2 spec/support/dummy/data.rb
graphql-1.8.17 spec/support/dummy/data.rb
graphql-1.8.16 spec/support/dummy/data.rb
graphql-1.9.1 spec/support/dummy/data.rb
graphql-1.9.0 spec/support/dummy/data.rb
graphql-1.8.15 spec/support/dummy/data.rb
graphql-1.9.0.pre4 spec/support/dummy/data.rb
graphql-1.8.14 spec/support/dummy/data.rb
graphql-1.9.0.pre3 spec/support/dummy/data.rb
graphql-1.9.0.pre2 spec/support/dummy/data.rb