Class: StormRETS

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/stormrets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, end_point, format) ⇒ StormRETS

Returns a new instance of StormRETS.



10
11
12
13
14
# File 'lib/stormrets.rb', line 10

def initialize(api_key, end_point, format)
  @api_key = api_key
  @end_point = end_point
  @format = format
end

Instance Attribute Details

#api_keyObject

debug_output $stdout



8
9
10
# File 'lib/stormrets.rb', line 8

def api_key
  @api_key
end

#end_pointObject

debug_output $stdout



8
9
10
# File 'lib/stormrets.rb', line 8

def end_point
  @end_point
end

#formatObject

debug_output $stdout



8
9
10
# File 'lib/stormrets.rb', line 8

def format
  @format
end

Instance Method Details

#search(options = {}) ⇒ Object



16
17
18
19
# File 'lib/stormrets.rb', line 16

def search(options={})
  options.merge!({:apikey => @api_key})
  data = self.class.get("http://www.stormrets.com#{@end_point}.#{@format}", :query => options)
end