Class: DhanHQ::Models::MultiOrder::Leg
- Defined in:
- lib/DhanHQ/models/multi_order.rb
Overview
One leg's result within a DhanHQ::Models::MultiOrder response.
Constant Summary
Constants included from ResponseHelper
ResponseHelper::STATUS_ERROR_FALLBACK
Instance Attribute Summary
Attributes inherited from BaseModel
Instance Method Summary collapse
-
#accepted? ⇒ Boolean
True when the exchange accepted this leg.
-
#rejected? ⇒ Boolean
True when this leg was rejected.
-
#to_prompt ⇒ Object
Returns a concise prompt-friendly summary of the leg.
Methods inherited from BaseModel
all, api, api_type, #assign_attributes, attributes, create, #delete, #destroy, find, #id, #initialize, #new_record?, #optionchain_api?, parse_collection_response, #persisted?, resource, resource_path, #save, #save!, #to_request_params, #update, #valid?, validate_attributes, validation_contract, #validation_contract, where
Methods included from APIHelper
Methods included from AttributeHelper
#camelize_keys, #deep_camelize_keys, #inspect, #normalize_keys, #snake_case, #titleize_keys
Methods included from ValidationHelper
#valid?, #validate!, #validate_params!
Methods included from RequestHelper
Constructor Details
This class inherits a constructor from DhanHQ::BaseModel
Instance Method Details
#accepted? ⇒ Boolean
Returns True when the exchange accepted this leg.
46 47 48 |
# File 'lib/DhanHQ/models/multi_order.rb', line 46 def accepted? !order_id.nil? && !rejected? end |
#rejected? ⇒ Boolean
Returns True when this leg was rejected.
51 52 53 |
# File 'lib/DhanHQ/models/multi_order.rb', line 51 def rejected? order_status.to_s == DhanHQ::Constants::OrderStatus::REJECTED end |
#to_prompt ⇒ Object
Returns a concise prompt-friendly summary of the leg.
56 57 58 |
# File 'lib/DhanHQ/models/multi_order.rb', line 56 def to_prompt "seq=#{sequence} order_id=#{order_id} status=#{order_status}" end |