class NekosLife::Client

The main module for interaction

Public Class Methods

add_image_endpoint(endpoint) click to toggle source

@!macro [attach] add_image_endpoint

@method $1
  Gets an image of `$1`
  @return [String] the image URL with the `$1` type.

@!visibility private

# File lib/nekos.rb, line 14
def self.add_image_endpoint(endpoint)
  @image_endpoints.push endpoint
  attr_reader endpoint
  define_method endpoint.downcase do
    API.img(endpoint)['url']
  end
end

Public Instance Methods

cat() click to toggle source

Gets an ascii cat @return [String] the cat

# File lib/nekos.rb, line 126
def cat
  API.get('cat')['cat']
end
chat(text, owo = false) click to toggle source

Chat with the API @param text [String] text to query @param owo [true, false] whether or not to owoify response text @return [String] the response

# File lib/nekos.rb, line 108
def chat(text, owo = false)
  API.get("chat?text=#{URI.encode(text)}#{'&owo=true' if owo}")['response']
end
eight_ball() click to toggle source

Gets an ascii cat @return [EightBallResponse] the response given with text and an image url

# File lib/nekos.rb, line 132
def eight_ball
  EightBallResponse.new(API.get('8ball'))
end
Also aliased as: eightball
eightball()
Alias for: eight_ball
fact() click to toggle source

Gets a random fact @return [String] the fact

# File lib/nekos.rb, line 114
def fact
  API.get('fact')['fact']
end
owoify(text) click to toggle source

OwOifys text. @param text [String] text to owoify @return [String] owoified text

# File lib/nekos.rb, line 100
def owoify(text)
  API.get("owoify?text=#{URI.encode(text)}")['owo']
end
why() click to toggle source

Gets a random question @return [String] the question

# File lib/nekos.rb, line 120
def why
  API.get('why')['why']
end