Class: NBS::Base

Inherits:
Object
  • Object
show all
Extended by:
MemcachedMemoize
Defined in:
lib/next-big-sound/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MemcachedMemoize

remember

Constructor Details

#initialize(api_key) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'lib/next-big-sound/base.rb', line 9

def initialize(api_key)
  $nbs_api_key = api_key
  #puts CACHE_ENABLED
end

Class Method Details

.t_to_d(string_timestamp) ⇒ Object



21
22
23
# File 'lib/next-big-sound/base.rb', line 21

def self.t_to_d(string_timestamp)
  return Date.parse(Time.at(string_timestamp.to_i).to_s)
end

Instance Method Details

#search(query, options = {}) ⇒ Object

return a search object that you can manipulate if you prefer to just use the xml simply type to_xml this method with actually fetch the result



16
17
18
19
20
# File 'lib/next-big-sound/base.rb', line 16

def search(query, options={} )
  search = NBS::Search.new(query,options)
  search.fetch
  return search
end