Class: NNEClient::Trade

Inherits:
Object
  • Object
show all
Defined in:
lib/nne_client/record_types/trade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trade_hash) ⇒ Trade

Returns a new instance of Trade.



5
6
7
8
9
# File 'lib/nne_client/record_types/trade.rb', line 5

def initialize(trade_hash)
  @primary = trade_hash[:primary]
  @trade_code = trade_hash[:trade_code]
  @trade = trade_hash[:trade]
end

Instance Attribute Details

#tradeObject (readonly)

Returns the value of attribute trade.



3
4
5
# File 'lib/nne_client/record_types/trade.rb', line 3

def trade
  @trade
end

#trade_codeObject (readonly)

Returns the value of attribute trade_code.



3
4
5
# File 'lib/nne_client/record_types/trade.rb', line 3

def trade_code
  @trade_code
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/nne_client/record_types/trade.rb', line 15

def ==(other)
  primary? == other.primary? &&
    trade_code == other.trade_code &&
    trade == other.trade
end

#primary?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/nne_client/record_types/trade.rb', line 11

def primary?
  @primary
end