Module: Anthropic::Models::BrowserClickTarget

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/browser_click_target.rb,
sig/anthropic/models/browser_click_target.rbs

Overview

Where to act: either a viewport coordinate or an element reference.

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, x:, y_:) ⇒ Anthropic::BrowserCoordinateTarget .new(type:, ref:) ⇒ Anthropic::BrowserRefTarget .new(type:, x:, y_:, ref:) ⇒ Anthropic::Models::browser_click_target

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Some parameter documentations has been truncated, see Anthropic::Models::BrowserClickTarget for more details.

Overloads:

Parameters:

  • type (Symbol, Anthropic::Models::BrowserClickTarget::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [Integer] :x Pixels from the left edge of the viewport.

    @option args [Integer] :y_ Pixels from the top edge of the viewport.

    @option args [String] :ref An element reference (e.g. "ref_7") returned by a prior read_page or find re

Returns:

Raises:

  • (ArgumentError)


51
52
53
54
55
56
57
58
59
60
# File 'lib/anthropic/models/browser_click_target.rb', line 51

def self.new(type:, **args)
  case type.to_sym
  when :coordinate
    Anthropic::BrowserCoordinateTarget.new(**args)
  when :ref
    Anthropic::BrowserRefTarget.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/browser_click_target.rb', line 26

.variants ⇒ Array(Anthropic::Models::BrowserCoordinateTarget, Anthropic::Models::BrowserRefTarget)



# File 'lib/anthropic/models/browser_click_target.rb', line 30