Module: FaradayJSON::ParseJson::OptionsExtension
- Defined in:
- lib/faraday_json/parse_json.rb
Overview
DRAGONS
Instance Attribute Summary collapse
-
#preserve_raw ⇒ Object
Returns the value of attribute preserve_raw.
Instance Method Summary collapse
Instance Attribute Details
#preserve_raw ⇒ Object
Returns the value of attribute preserve_raw.
98 99 100 |
# File 'lib/faraday_json/parse_json.rb', line 98 def preserve_raw @preserve_raw end |
Instance Method Details
#each {|:preserve_raw, preserve_raw| ... } ⇒ Object
104 105 106 107 108 |
# File 'lib/faraday_json/parse_json.rb', line 104 def each return to_enum(:each) unless block_given? super yield :preserve_raw, preserve_raw end |
#fetch(key, *args) ⇒ Object
110 111 112 113 114 115 116 117 |
# File 'lib/faraday_json/parse_json.rb', line 110 def fetch(key, *args) if :preserve_raw == key value = __send__(key) value.nil? ? args.fetch(0) : value else super end end |
#to_hash ⇒ Object
100 101 102 |
# File 'lib/faraday_json/parse_json.rb', line 100 def to_hash super.update(:preserve_raw => preserve_raw) end |