class Clashdata

Chashdata class

Attributes

arenas[RW]
cards[RW]
chests[RW]
players[RW]

Public Class Methods

new() click to toggle source
# File lib/ClashRoyale.rb, line 15
def initialize
  @players = []
  @chests = []
  @arenas = []
  @cards =  []
end

Private Instance Methods

fetch(type) click to toggle source
# File lib/ClashRoyale.rb, line 44
def fetch(type)
  begin
    request = HTTParty.get("http://www.clashapi.xyz/api/#{type}", format: :json).parsed_response
  rescue => e
    puts "Rescued #{e.inspect}"
  end
end