Class: BetfairApiNgRails::Api::Hashalator
- Inherits:
-
Object
- Object
- BetfairApiNgRails::Api::Hashalator
- Includes:
- Data::Constants
- Defined in:
- lib/betfair_api_ng_rails/api/hashalator.rb
Constant Summary
Constants included from Data::Constants
Instance Attribute Summary collapse
-
#for_param ⇒ Object
readonly
Returns the value of attribute for_param.
-
#hashable ⇒ Object
readonly
Returns the value of attribute hashable.
Instance Method Summary collapse
-
#initialize(object, for_param = false) ⇒ Hashalator
constructor
A new instance of Hashalator.
- #to_hash ⇒ Object
Constructor Details
#initialize(object, for_param = false) ⇒ Hashalator
Returns a new instance of Hashalator.
8 9 10 11 |
# File 'lib/betfair_api_ng_rails/api/hashalator.rb', line 8 def initialize(object, for_param = false) @hashable = object @for_param = for_param end |
Instance Attribute Details
#for_param ⇒ Object (readonly)
Returns the value of attribute for_param.
6 7 8 |
# File 'lib/betfair_api_ng_rails/api/hashalator.rb', line 6 def for_param @for_param end |
#hashable ⇒ Object (readonly)
Returns the value of attribute hashable.
6 7 8 |
# File 'lib/betfair_api_ng_rails/api/hashalator.rb', line 6 def hashable @hashable end |
Instance Method Details
#to_hash ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/betfair_api_ng_rails/api/hashalator.rb', line 13 def to_hash hashable.inject({}) do |h, (k, v)| value = hash_value(v) h[hash_key(k)] = value if !value.nil? && value != "" h end end |