Class: OptionLab::Models::ClosedPosition
- Defined in:
- lib/option_lab/models.rb
Overview
Closed position model
Instance Attribute Summary collapse
-
#prev_pos ⇒ Object
Returns the value of attribute prev_pos.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ClosedPosition
constructor
A new instance of ClosedPosition.
- #validate! ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ClosedPosition
Returns a new instance of ClosedPosition.
70 71 72 73 |
# File 'lib/option_lab/models.rb', line 70 def initialize(attributes = {}) @type = 'closed' super(attributes) end |
Instance Attribute Details
#prev_pos ⇒ Object
Returns the value of attribute prev_pos.
67 68 69 |
# File 'lib/option_lab/models.rb', line 67 def prev_pos @prev_pos end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
68 69 70 |
# File 'lib/option_lab/models.rb', line 68 def type @type end |
Instance Method Details
#validate! ⇒ Object
75 76 77 |
# File 'lib/option_lab/models.rb', line 75 def validate! raise ArgumentError, 'prev_pos must be a number' unless prev_pos.is_a?(Numeric) end |