Class: ClickClient::FX::Rate

Inherits:
Base
  • Object
show all
Defined in:
lib/clickclient/fx.rb

Overview

レート

定義済みの属性の他に、レスポンスXMLの要素名、属性名でも値にアクセスできます。 レスポンスXMLについては、クリック証券提供のドキュメントを参照ください。

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#eql?, #hash, #method_missing, #to_s

Constructor Details

#initialize(item) ⇒ Rate

コンストラクタ

item

結果要素



650
651
652
653
654
655
656
657
658
659
660
661
662
# File 'lib/clickclient/fx.rb', line 650

def initialize( item )
  super(item)
  @currency_pair_code = item.get_elements("./tsukaPair")[0].attributes["tsukaPairCode"].to_i
  @bid_rate = item.text( "./bid" ).to_f
  @ask_rate = item.text( "./ask" ).to_f
  @day_before_to = item.text( "./zenjitsuhi" ).to_f
  @bid_high = item.text( "./bidHigh" ).to_f
  @bid_low = item.text( "./bidLow" ).to_f
  @buy_swap = item.text( "./kaiSwap" ).to_i
  @sell_swap = item.text( "./uriSwap" ).to_i
  @date = DateTime.strptime( item.text( "./hasseibi" ), "%Y-%m-%d")
  @days_of_grant = item.text( "./fuyoNissu" ).to_i
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClickClient::Base

Instance Attribute Details

#ask_rateObject

Askレート



668
669
670
# File 'lib/clickclient/fx.rb', line 668

def ask_rate
  @ask_rate
end

#bid_highObject

Bidレート高値



672
673
674
# File 'lib/clickclient/fx.rb', line 672

def bid_high
  @bid_high
end

#bid_lowObject

Bidレート安値



674
675
676
# File 'lib/clickclient/fx.rb', line 674

def bid_low
  @bid_low
end

#bid_rateObject

Bidレート



666
667
668
# File 'lib/clickclient/fx.rb', line 666

def bid_rate
  @bid_rate
end

#buy_swapObject

買スワップポイント(円)



676
677
678
# File 'lib/clickclient/fx.rb', line 676

def buy_swap
  @buy_swap
end

#currency_pair_codeObject

通貨ペアコード



664
665
666
# File 'lib/clickclient/fx.rb', line 664

def currency_pair_code
  @currency_pair_code
end

#dateObject

発生日



680
681
682
# File 'lib/clickclient/fx.rb', line 680

def date
  @date
end

#day_before_toObject

前日終値比。現在のBidレートと直近のNYクローズ時のBidレートとの差。



670
671
672
# File 'lib/clickclient/fx.rb', line 670

def day_before_to
  @day_before_to
end

#days_of_grantObject

付与日数



682
683
684
# File 'lib/clickclient/fx.rb', line 682

def days_of_grant
  @days_of_grant
end

#sell_swapObject

売スワップポイント(円)



678
679
680
# File 'lib/clickclient/fx.rb', line 678

def sell_swap
  @sell_swap
end