Sha256: dd96b6abcb31b3c9681e508bb43dad1a0f8a541cbebae3b8c4a7032df4b1b2cc

Contents?: true

Size: 1.05 KB

Versions: 31

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true
require 'ostruct'
module Dummy
  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

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

  Milk = Struct.new(:id, :fatContent, :origin, :source, :flavors)
  MILKS = {
    1 => Milk.new(1, 0.04, "Antiquity", 1, ["Natural", "Chocolate", "Strawberry"]),
  }

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

  Cow = Struct.new(:id, :name, :last_produced_dairy)
  COWS = {
    1 => Cow.new(1, "Billy", MILKS[1])
  }

  Goat = Struct.new(:id, :name, :last_produced_dairy)
  GOATS = {
    1 => Goat.new(1, "Gilly", MILKS[1]),
  }
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
graphql-1.8.8 spec/support/dummy/data.rb
graphql-1.8.7 spec/support/dummy/data.rb
graphql-1.8.6 spec/support/dummy/data.rb
graphql-1.8.5 spec/support/dummy/data.rb
graphql-1.8.4 spec/support/dummy/data.rb
graphql-1.8.3 spec/support/dummy/data.rb
graphql-1.8.2 spec/support/dummy/data.rb
graphql-1.8.1 spec/support/dummy/data.rb
graphql-1.8.0 spec/support/dummy/data.rb
graphql-1.8.0.pre11 spec/support/dummy/data.rb
graphql-1.8.0.pre10 spec/support/dummy/data.rb
graphql-1.7.14 spec/support/dummy/data.rb
graphql-1.8.0.pre9 spec/support/dummy/data.rb
graphql-1.8.0.pre8 spec/support/dummy/data.rb
graphql-1.7.13 spec/support/dummy/data.rb
graphql-1.8.0.pre7 spec/support/dummy/data.rb
graphql-1.7.12 spec/support/dummy/data.rb
graphql-1.7.11 spec/support/dummy/data.rb
graphql-1.7.10 spec/support/dummy/data.rb
graphql-1.8.0.pre6 spec/support/dummy/data.rb