Class: Securities::Lookup
- Inherits:
-
Object
- Object
- Securities::Lookup
- Defined in:
- lib/securities/lookup.rb
Overview
Symbol lookup with Securities::Lookup.new(‘apple’)
Defined Under Namespace
Classes: LookupException
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(parameters) ⇒ Lookup
constructor
A new instance of Lookup.
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
#input ⇒ Object
Returns the value of attribute input.
7 8 9 |
# File 'lib/securities/lookup.rb', line 7 def input @input end |
#output ⇒ Object
Returns the value of attribute output.
7 8 9 |
# File 'lib/securities/lookup.rb', line 7 def output @output end |