Class: AdequateJson::Hash
- Inherits:
-
Object
- Object
- AdequateJson::Hash
- Defined in:
- lib/adequate_json/hash.rb
Instance Method Summary collapse
-
#initialize(hash, json = nil, variants: {}) ⇒ Hash
constructor
A new instance of Hash.
- #to_builder ⇒ Object
Methods included from Jsonizer
Methods included from Resolver
Constructor Details
#initialize(hash, json = nil, variants: {}) ⇒ Hash
Returns a new instance of Hash.
8 9 10 11 12 |
# File 'lib/adequate_json/hash.rb', line 8 def initialize(hash, json = nil, variants: {}, **) @hash = hash @json = json @variants = variants end |
Instance Method Details
#to_builder ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/adequate_json/hash.rb', line 14 def to_builder if @json.nil? Jbuilder.new do |json| @json = json serialize_hash end else serialize_hash end end |