Class: Alphavantage::Crypto
- Inherits:
-
Object
- Object
- Alphavantage::Crypto
- Includes:
- HelperFunctions
- Defined in:
- lib/Crypto.rb
Instance Attribute Summary collapse
-
#datatype ⇒ Object
Returns the value of attribute datatype.
-
#market ⇒ Object
Returns the value of attribute market.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(symbol:, datatype: "json", key:, verbose: false, market:) ⇒ Crypto
constructor
A new instance of Crypto.
- #timeseries(type: "intraday", market: @market, file: nil, datatype: @datatype) ⇒ Object
Methods included from HelperFunctions
#check_argument, #check_datatype, #method_missing, #open_struct, #recreate_metadata_key, #return_client, #return_int_val, #return_matype, #return_series, #return_value, #which_series
Constructor Details
#initialize(symbol:, datatype: "json", key:, verbose: false, market:) ⇒ Crypto
Returns a new instance of Crypto.
5 6 7 8 9 10 11 |
# File 'lib/Crypto.rb', line 5 def initialize symbol:, datatype: "json", key:, verbose: false, market: check_argument([true, false], verbose, "verbose") @client = return_client(key, verbose) @symbol = symbol @market = market @datatype = datatype end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class HelperFunctions
Instance Attribute Details
#datatype ⇒ Object
Returns the value of attribute datatype.
14 15 16 |
# File 'lib/Crypto.rb', line 14 def datatype @datatype end |
#market ⇒ Object
Returns the value of attribute market.
13 14 15 |
# File 'lib/Crypto.rb', line 13 def market @market end |
#symbol ⇒ Object
Returns the value of attribute symbol.
13 14 15 |
# File 'lib/Crypto.rb', line 13 def symbol @symbol end |
Instance Method Details
#timeseries(type: "intraday", market: @market, file: nil, datatype: @datatype) ⇒ Object
21 22 23 24 |
# File 'lib/Crypto.rb', line 21 def timeseries type: "intraday", market: @market, file: nil, datatype: @datatype Alphavantage::Crypto_Timeseries.new type: type, market: market, symbol: @symbol, datatype: datatype, file: file, key: @client end |