Module: GW2::Recipe

Extended by:
GW2
Defined in:
lib/gw2/recipe.rb,
lib/gw2/recipe/recipes.rb,
lib/gw2/recipe/recipe_details.rb

Constant Summary

Constants included from GW2

BASE_URL

Class Method Summary collapse

Methods included from GW2

request

Class Method Details

.allObject



3
4
5
6
7
8
9
10
11
# File 'lib/gw2/recipe/recipes.rb', line 3

def self.all
  response = request(
    action: "Get",
    ssl: true,
    url: "#{BASE_URL}/recipes.json"
  )

  return JSON.parse(response.body)
end

.details(recipe_id) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/gw2/recipe/recipe_details.rb', line 3

def self.details(recipe_id)
  response = request(
    action: "Get",
    ssl: true,
    url: "#{BASE_URL}/recipe_details.json?recipe_id=#{recipe_id}"
  )

  return JSON.parse(response.body)
end