Class: Evil::Client::Builder::Scope

Inherits:
Evil::Client::Builder show all
Defined in:
lib/evil/client/builder/scope.rb

Overview

Lazy container for a [#schema] and [#parent] settings of a [#new] scope to be initialized with its own options, that reload the [#parent] ones.

Instance Attribute Summary

Attributes inherited from Evil::Client::Builder

#parent, #schema

Instance Method Summary collapse

Methods inherited from Evil::Client::Builder

#inspect, #to_str

Instance Method Details

#new(options) ⇒ Evil::Client::Container::Scope Also known as: call, []

Builds new scope with options reloading those of its [#parent]

Parameters:

  • options (Hash<Symbol, Object>)

    Custom options

Returns:



25
26
27
# File 'lib/evil/client/builder/scope.rb', line 25

def new(**options)
  Container::Scope.new schema, parent.options.merge(options)
end

#to_sString

Human-readable representation of the handler

Examples:

'#<MyClient.scopes[:crm] @version="1.1">.scopes[:users]'

Returns:

  • (String)


15
16
17
# File 'lib/evil/client/builder/scope.rb', line 15

def to_s
  "#{parent}.scopes[:#{schema.name}]"
end