class Supa::Builder

Constants

COMMANDS_WITH_DEFAULT_INTERFACE

Public Class Methods

new(subject, representer:, tree:) click to toggle source
# File lib/supa/builder.rb, line 5
def initialize(subject, representer:, tree:)
  @subject = subject
  @representer = representer
  @tree = tree
end

Public Instance Methods

attributes(*names, **options) click to toggle source
# File lib/supa/builder.rb, line 24
def attributes(*names, **options)
  Supa::Commands::Attributes.new(
    @subject, representer: @representer, tree: @tree, name: names, options: options
  ).represent
end
to_hash() click to toggle source
# File lib/supa/builder.rb, line 30
def to_hash
  @tree.to_hash
end
to_json() click to toggle source
# File lib/supa/builder.rb, line 34
def to_json
  Oj.dump(to_hash, mode: :strict)
end