module HNsearch

The driver

Constants

VERSION

Public Class Methods

filter(result) click to toggle source

Example:

>> HNsearch.filter(some_json_object)
=> Returns result key-value from the JSON object

Arguments:

result: (JSON object)
# File lib/HNsearch.rb, line 43
def self.filter(result)
  return result.fetch("results")
end
items(query) click to toggle source

Example:

>> HNsearch.items("awesome")
=> Returns JSON object of the result and then runs print_items

Arguments:

query: (String)
# File lib/HNsearch.rb, line 29
def self.items(query)
  result = HNsearchAPI.new.query_items(query)
  print_items filter(result)
end
print_items(result) click to toggle source
print_users(result) click to toggle source

Example:

>> HNsearch.filter(some_json_object)
=> Returns result key-value from the JSON object

Arguments:

result: (JSON object)
users(query) click to toggle source

Example:

>> HNsearch.users("aniketpant")
=> Returns JSON object of the result and then runs print_users

Arguments:

query: (String)
# File lib/HNsearch.rb, line 15
def self.users(query)
  result = HNsearchAPI.new.query_users(query)
  print_users filter(result)
end