Class: Prismdb::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/prismdb/client.rb

Instance Method Summary collapse

Instance Method Details

#find_character(key) ⇒ Prismdb::Response

Parameters:

  • key (String)

Returns:



13
14
15
16
17
# File 'lib/prismdb/client.rb', line 13

def find_character(key)
  with_error_handling do
    connection.get("/api/character/#{key}").body
  end
end

#find_episode(key) ⇒ Prismdb::Response

Parameters:

  • key (String)

Returns:



29
30
31
32
33
# File 'lib/prismdb/client.rb', line 29

def find_episode(key)
  with_error_handling do
    connection.get("/api/episode/#{key}").body
  end
end

#find_live(key) ⇒ Prismdb::Response

Parameters:

  • key (String)

Returns:



61
62
63
64
65
# File 'lib/prismdb/client.rb', line 61

def find_live(key)
  with_error_handling do
    connection.get("/api/live/#{key}").body
  end
end

#find_series(key) ⇒ Prismdb::Response

Parameters:

  • key (String)

Returns:



77
78
79
80
81
# File 'lib/prismdb/client.rb', line 77

def find_series(key)
  with_error_handling do
    connection.get("/api/series/#{key}").body
  end
end

#find_song(key) ⇒ Prismdb::Response

Parameters:

  • key (String)

Returns:



45
46
47
48
49
# File 'lib/prismdb/client.rb', line 45

def find_song(key)
  with_error_handling do
    connection.get("/api/song/#{key}").body
  end
end

#get_charactersArray<Prismdb::Response>

Returns:



4
5
6
7
8
# File 'lib/prismdb/client.rb', line 4

def get_characters
  with_error_handling do
    connection.get("/api/character").body["results"]
  end
end

#get_episodesArray<Prismdb::Response>

Returns:



20
21
22
23
24
# File 'lib/prismdb/client.rb', line 20

def get_episodes
  with_error_handling do
    connection.get("/api/episode").body["results"]
  end
end

#get_livesArray<Prismdb::Response>

Returns:



52
53
54
55
56
# File 'lib/prismdb/client.rb', line 52

def get_lives
  with_error_handling do
    connection.get("/api/live").body["results"]
  end
end

#get_seriesArray<Prismdb::Response>

Returns:



68
69
70
71
72
# File 'lib/prismdb/client.rb', line 68

def get_series
  with_error_handling do
    connection.get("/api/series").body["results"]
  end
end

#get_songsArray<Prismdb::Response>

Returns:



36
37
38
39
40
# File 'lib/prismdb/client.rb', line 36

def get_songs
  with_error_handling do
    connection.get("/api/song").body["results"]
  end
end