Class: IGMarkets::MarketHierarchyResult::HierarchyNode

Inherits:
IGMarkets::Model show all
Defined in:
lib/ig_markets/market_hierarchy_result.rb

Overview

Contains details on a single node in the market hierarchy. Used by #nodes.

Instance Attribute Summary

Attributes inherited from IGMarkets::Model

#attributes

Instance Method Summary collapse

Methods inherited from IGMarkets::Model

#==, allowed_values, attribute, attribute_type, attribute_value_allowed?, defined_attribute_names, deprecated_attribute, #initialize, #initialize_copy, #inspect, #to_h, valid_attribute?

Constructor Details

This class inherits a constructor from IGMarkets::Model

Instance Method Details

#idObject

The id attribute.

Returns:



6
# File 'lib/ig_markets/market_hierarchy_result.rb', line 6

attribute :id

#marketsArray<MarketOverview>

Returns an array of the markets under this node in the market hierarchy.

Returns:



12
13
14
# File 'lib/ig_markets/market_hierarchy_result.rb', line 12

def markets
  @dealing_platform.markets.hierarchy(id).markets
end

#nameObject

The name attribute.

Returns:



7
# File 'lib/ig_markets/market_hierarchy_result.rb', line 7

attribute :name

#nodesArray<HierarchyNode>

Returns an array of the child nodes under this node in the market hierarchy.

Returns:



19
20
21
# File 'lib/ig_markets/market_hierarchy_result.rb', line 19

def nodes
  @nodes ||= @dealing_platform.markets.hierarchy(id).nodes
end