Class: Tradier::Watchlist

Inherits:
Base
  • Object
show all
Defined in:
lib/tradier/watchlist.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

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Class Method Details

.from_response(body = {}) ⇒ Object



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

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

Instance Method Details

#itemsObject



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

def items
  @items ||= @attrs[:items][:item].map { |i| Tradier::WatchlistItem.new(i) }
end