Module: Bitfinex::RESTv2Positions
- Included in:
- RESTv2
- Defined in:
- lib/rest/v2/positions.rb
Instance Method Summary collapse
-
#claim_position(position) ⇒ Array
Claim an active position.
Instance Method Details
#claim_position(position) ⇒ Array
Claim an active position
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rest/v2/positions.rb', line 10 def claim_position(position) if position.is_a?(Numeric) id = position elsif position.is_a?(Array) id = position[0] elsif position.instance_of?(Models::Position) id = position.id elsif position.kind_of?(Hash) id = position[:id] || position['id'] else raise Exception, 'tried to claim position with invalid ID' end authenticated_post("auth/w/position/claim", params: { :id => id }).body end |