Class: Tradier::Adjustment

Inherits:
Base
  • Object
show all
Defined in:
lib/tradier/adjustment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #attr_equal, attr_reader, #attrs, #attrs_equal, #initialize, #update

Constructor Details

This class inherits a constructor from Tradier::Base

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/tradier/adjustment.rb', line 6

def type
  @type
end

Class Method Details

.from_response(body = {}) ⇒ Object



12
13
14
# File 'lib/tradier/adjustment.rb', line 12

def self.from_response(body={})
  new(body[:balances] || body)
end

Instance Method Details

#strikesObject



8
9
10
# File 'lib/tradier/adjustment.rb', line 8

def strikes
  @strikes ||= (@attrs[:strikes][:strike] || [])
end