Class: Securities::Lookup

Inherits:
Object
  • Object
show all
Defined in:
lib/securities/lookup.rb

Overview

Symbol lookup with Securities::Lookup.new(‘apple’)

Defined Under Namespace

Classes: LookupException

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters) ⇒ Lookup

Returns a new instance of Lookup.



11
12
13
14
15
16
17
18
19
# File 'lib/securities/lookup.rb', line 11

def initialize parameters
	@input = parameters
	if @input.delete(' ').empty?
		raise LookupException, 'The lookup input was empty.'
	end
	url = generate_lookup_url
	request = :lookup
	@output = Securities::Scraper.get(request, url)
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



7
8
9
# File 'lib/securities/lookup.rb', line 7

def input
  @input
end

#outputObject

Returns the value of attribute output.



7
8
9
# File 'lib/securities/lookup.rb', line 7

def output
  @output
end