Class: Supa::Builder
- Inherits:
-
Object
- Object
- Supa::Builder
- Defined in:
- lib/supa/builder.rb
Constant Summary collapse
- COMMANDS =
%w(attribute virtual object namespace collection append).freeze
Instance Method Summary collapse
-
#initialize(representer:, context:, tree:) ⇒ Builder
constructor
A new instance of Builder.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(representer:, context:, tree:) ⇒ Builder
Returns a new instance of Builder.
25 26 27 28 29 |
# File 'lib/supa/builder.rb', line 25 def initialize(representer:, context:, tree:) @representer = representer @context = context @tree = tree end |
Instance Method Details
#to_hash ⇒ Object
31 32 33 |
# File 'lib/supa/builder.rb', line 31 def to_hash tree.to_hash end |
#to_json ⇒ Object
35 36 37 |
# File 'lib/supa/builder.rb', line 35 def to_json to_hash.to_json end |