Class: PATokenProxyOptions
- Inherits:
-
Object
- Object
- PATokenProxyOptions
- Defined in:
- lib/pa_proxies/pa_token_proxy_options.rb
Instance Attribute Summary collapse
-
#indices_hash ⇒ Object
Returns the value of attribute indices_hash.
-
#options_hash ⇒ Object
Returns the value of attribute options_hash.
Class Method Summary collapse
Instance Method Summary collapse
- #get_current_index(array) ⇒ Object
- #inc_index(array) ⇒ Object
-
#initialize(p_options) ⇒ PATokenProxyOptions
constructor
A new instance of PATokenProxyOptions.
- #reset ⇒ Object
Constructor Details
#initialize(p_options) ⇒ PATokenProxyOptions
Returns a new instance of PATokenProxyOptions.
18 19 20 21 22 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 18 def initialize() self. = self.indices_hash = {} reset end |
Instance Attribute Details
#indices_hash ⇒ Object
Returns the value of attribute indices_hash.
3 4 5 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 3 def indices_hash @indices_hash end |
#options_hash ⇒ Object
Returns the value of attribute options_hash.
2 3 4 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 2 def @options_hash end |
Class Method Details
.new_if_needed(p_options) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 5 def self.new_if_needed() if (.is_a? PATokenProxyOptions) return else return self.new() end end |
Instance Method Details
#get_current_index(array) ⇒ Object
24 25 26 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 24 def get_current_index(array) return indices_hash[array.object_id.to_s] end |
#inc_index(array) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 28 def inc_index(array) indices_hash[array.object_id.to_s] = indices_hash[array.object_id.to_s] + 1 if indices_hash[array.object_id.to_s] >= array.length indices_hash[array.object_id.to_s]= 0 end end |
#reset ⇒ Object
13 14 15 16 |
# File 'lib/pa_proxies/pa_token_proxy_options.rb', line 13 def reset calculate_indices() if !@added_indices @added_indices = true end |