Class: RMarket::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/rmarket/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, price, trader = nil, quantity = 1, asset_label = "") ⇒ Order

Returns a new instance of Order.



6
7
8
# File 'lib/rmarket/order.rb', line 6

def initialize(type, price, trader=nil, quantity=1, asset_label="")
  @type, @price, @trader, @quantity, @asset_label = type, price, trader, quantity, asset_label
end

Instance Attribute Details

#asset_labelObject (readonly)

Returns the value of attribute asset_label.



3
4
5
# File 'lib/rmarket/order.rb', line 3

def asset_label
  @asset_label
end

#priceObject (readonly)

Returns the value of attribute price.



3
4
5
# File 'lib/rmarket/order.rb', line 3

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



4
5
6
# File 'lib/rmarket/order.rb', line 4

def quantity
  @quantity
end

#traderObject (readonly)

Returns the value of attribute trader.



3
4
5
# File 'lib/rmarket/order.rb', line 3

def trader
  @trader
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/rmarket/order.rb', line 3

def type
  @type
end