lib/client.rb in ruby-trade-0.1 vs lib/client.rb in ruby-trade-0.2
- old
+ new
@@ -114,10 +114,11 @@
# Process a message from the server
def handle_message data
case data["action"]
when "order_accept"
+ @orders[data["local_id"]].price = data["price"]
when "order_fill"
update_account data
@@parent.on_fill @orders[data["local_id"]], data["amount"], data["price"]
when "order_partial_fill"
update_account data
@@ -134,15 +135,15 @@
end
end
end
module Client
- def self.on_connect *args; end
- def self.on_tick *args; end
- def self.on_fill *args; end
- def self.on_partial_fill *args; end
-
module ClassMethods
+ def on_connect *args; end
+ def on_tick *args; end
+ def on_fill *args; end
+ def on_partial_fill *args; end
+
# hook so we can call child methods
def child= child
@@child = child
end