class Capwatch::Fund::Config

Attributes

parser[R]
source[R]

Public Class Methods

new(source: nil) click to toggle source
# File lib/capwatch/fund/config.rb, line 13
def initialize(source: nil)
  @source = source || dynamic_source
  @parser = Parser.new(source: dynamic_source)
end

Public Instance Methods

coins() click to toggle source
# File lib/capwatch/fund/config.rb, line 22
def coins
  positions.map do |symbol, quantity|
    Coin.new do |coin|
      coin.symbol   = symbol
      coin.quantity = quantity
    end
  end
end
demo?() click to toggle source
# File lib/capwatch/fund/config.rb, line 31
def demo?
  name == Demo::NAME
end
dynamic_source() click to toggle source
# File lib/capwatch/fund/config.rb, line 18
def dynamic_source
  File.exist?(File.expand_path((Remote::FILE_NAME))) ? Remote.new : Local.new
end