lib/voilkruby/chain.rb
# Returns the current base (e.g. VOILK) price in the debt asset (e.g VSD).
#
Returns the current base  price in the debt asset .
Returns the current base price in the debt asset .
def base_per_debt
      api.get_feed_history do |feed_history|
        current_median_history = feed_history.current_median_history
        base = current_median_history.base
        base = base.split(' ').first.to_f
        quote = current_median_history.quote
        quote = quote.split(' ').first.to_f
        (base / quote) * base_per_mcoin
      end
    end
def base_per_debt api . get_feed_history do | feed_history | current_median_history = feed_history . current_median_history base = current_median_history . base base = base . split ( ' ' ) . first . to_f quote = current_median_history . quote quote = quote . split ( ' ' ) . first . to_f ( base / quote ) * base_per_mcoin end end
Returns the current base (e.g.
Returns the current base ( e . g .