Skip to content

Commit

Permalink
leishman#3 - More symmetry/flexibility in agreement w/ new specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkybro committed Mar 13, 2014
1 parent 27b7be7 commit e6e8cf8
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/kraken_ruby/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,27 @@ def server_time
get_public 'Time'
end

def assets(opts={})
get_public 'Assets'
def assets(assets=nil, opts={})
if assets
raise ArgumentError if !assets.is_a?(String)
opts[:asset] = assets
end
get_public 'Assets', opts
end

def asset_pairs(opts={})
def asset_pairs(asset_pairs=nil, opts={})
if asset_pairs
raise ArgumentError if !asset_pairs.is_a?(String)
opts[:pair] = asset_pairs
end
get_public 'AssetPairs', opts
end

def ticker(pairs) # takes string of comma delimited pairs
opts = { 'pair' => pairs }
def ticker(asset_pairs=nil, opts={}) # takes string of comma delimited pairs
if asset_pairs
raise ArgumentError if !asset_pairs.is_a?(String)
opts[:pair] = asset_pairs
end
get_public 'Ticker', opts
end

Expand Down

0 comments on commit e6e8cf8

Please sign in to comment.