Class: Supa::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/supa/builder.rb

Constant Summary collapse

COMMANDS =
%w(attribute object namespace collection polymorphic).freeze

Instance Method Summary collapse

Constructor Details

#initialize(context:, tree:) ⇒ Builder

Returns a new instance of Builder.



23
24
25
26
# File 'lib/supa/builder.rb', line 23

def initialize(context:, tree:)
  @context = context
  @tree = tree
end

Instance Method Details

#to_hashObject



28
29
30
# File 'lib/supa/builder.rb', line 28

def to_hash
  tree.to_hash
end

#to_jsonObject



32
33
34
# File 'lib/supa/builder.rb', line 32

def to_json
  to_hash.to_json
end