Class: Hatolence::Offense

Inherits:
Object
  • Object
show all
Includes:
HttpClient, ParamsBuilder
Defined in:
lib/hatolence/offense.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ParamsBuilder

#params

Methods included from HttpClient

#build_request, #get_resource, #resource, #root_url

Class Method Details

.allObject



6
7
8
# File 'lib/hatolence/offense.rb', line 6

def self.all
  self.new.all
end

.filter_by(*category) ⇒ Object



10
11
12
# File 'lib/hatolence/offense.rb', line 10

def self.filter_by *category
  self.new.filter_by(category)
end

Instance Method Details

#allObject



14
15
16
17
# File 'lib/hatolence/offense.rb', line 14

def all
  result = get_resource
  JSON.parse(result)
end

#filter_by(category) ⇒ Object



19
20
21
22
# File 'lib/hatolence/offense.rb', line 19

def filter_by category
  result = get_resource(params("category",category))
  JSON.parse(result)
end