Class: Darwinex::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/darwinex/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_name:, info_api:) ⇒ Product

Returns a new instance of Product.



7
8
9
10
# File 'lib/darwinex/product.rb', line 7

def initialize(product_name:, info_api:)
  @product_name = product_name
  @info_api = info_api
end

Instance Attribute Details

#product_nameObject (readonly)

Returns the value of attribute product_name.



5
6
7
# File 'lib/darwinex/product.rb', line 5

def product_name
  @product_name
end

Instance Method Details

#badgesObject



25
26
27
# File 'lib/darwinex/product.rb', line 25

def badges
  info_api.get_badges(product_name)
end

#candles(resolution: nil, from:, to:) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/darwinex/product.rb', line 12

def candles(resolution: nil, from:, to:)
  info_api.get_candles(
    product_name,
    resolution: resolution,
    from: from,
    to: to
  )
end

#capacityObject



57
58
59
# File 'lib/darwinex/product.rb', line 57

def capacity
  info_api.get_capacity(product_name)
end

#close_strategyObject



29
30
31
# File 'lib/darwinex/product.rb', line 29

def close_strategy
  info_api.get_close_strategy(product_name)
end

#duration_consistencyObject



33
34
35
# File 'lib/darwinex/product.rb', line 33

def duration_consistency
  info_api.get_duration_consistency(product_name)
end

#dxscoreObject



21
22
23
# File 'lib/darwinex/product.rb', line 21

def dxscore
  info_api.get_dxscore(product_name)
end

#experienceObject



37
38
39
# File 'lib/darwinex/product.rb', line 37

def experience
  info_api.get_experience(product_name)
end

#losing_consistencyObject



41
42
43
# File 'lib/darwinex/product.rb', line 41

def losing_consistency
  info_api.get_losing_consistency(product_name)
end

#market_correlationObject



45
46
47
# File 'lib/darwinex/product.rb', line 45

def market_correlation
  info_api.get_market_correlation(product_name)
end

#monthly_divergenceObject



85
86
87
# File 'lib/darwinex/product.rb', line 85

def monthly_divergence
  info_api.get_monthly_divergence(product_name)
end

#open_strategyObject



53
54
55
# File 'lib/darwinex/product.rb', line 53

def open_strategy
  info_api.get_open_strategy(product_name)
end

#order_divergenceObject



77
78
79
# File 'lib/darwinex/product.rb', line 77

def order_divergence
  info_api.get_order_divergence(product_name)
end

#performanceObject



49
50
51
# File 'lib/darwinex/product.rb', line 49

def performance
  info_api.get_performance(product_name)
end

#quotes(from: nil, to: nil) ⇒ Object



61
62
63
# File 'lib/darwinex/product.rb', line 61

def quotes(from: nil, to: nil)
  info_api.get_quotes(product_name, from: from, to: to)
end

#return_divergenceObject



81
82
83
# File 'lib/darwinex/product.rb', line 81

def return_divergence
  info_api.get_return_divergence(product_name)
end

#risk_adjustmentObject



65
66
67
# File 'lib/darwinex/product.rb', line 65

def risk_adjustment
  info_api.get_risk_adjustment(product_name)
end

#risk_stabilityObject



69
70
71
# File 'lib/darwinex/product.rb', line 69

def risk_stability
  info_api.get_risk_stability(product_name)
end

#scores(badge: nil) ⇒ Object



93
94
95
96
97
98
99
# File 'lib/darwinex/product.rb', line 93

def scores(badge: nil)
  if badge.nil?
    info_api.get_product_scores(product_name)
  else
    info_api.get_product_scores_badge(product_name, badge)
  end
end

#statusObject



89
90
91
# File 'lib/darwinex/product.rb', line 89

def status
  info_api.get_product_status(product_name)
end

#winning_consistencyObject



73
74
75
# File 'lib/darwinex/product.rb', line 73

def winning_consistency
  info_api.get_winning_consistency(product_name)
end