Sha256: 81817766a4c6dc10dcae03e438c0178c963aca60f6002b3dd97d787353e690c4

Contents?: true

Size: 1.12 KB

Versions: 11

Compression:

Stored size: 1.12 KB

Contents

class Evil::Client
  #
  # @abstract
  # Base class for scope/operation builders
  #
  # Every builder just wraps scope/operation schema along with
  # preinitialized [#parent] settings of its super-scope.
  # The instance method [#new] quacks like the lazy constructor
  # for scope/operation instance whose options reload the [#parent]'s ones.
  #
  class Builder
    Names.clean(self) # Remove unnecessary methods from the instance

    # Load concrete implementations for the abstact builder
    require_relative "builder/scope"
    require_relative "builder/operation"

    # The schema for an instance to be constructed via [#new]
    # @return [Evil::Client::Schema]
    attr_reader :schema

    # The instance of parent scope carrying default settings
    # @return [Evil::Client::Container::Scope]
    attr_reader :parent

    # Alias method for [#to_s]
    #
    # @return [String]
    #
    def to_str
      to_s
    end

    # Alias method for [#to_s]
    #
    # @return [String]
    #
    def inspect
      to_s
    end

    private

    def initialize(schema, parent)
      @schema = schema
      @parent = parent
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
evil-client-3.2.0 lib/evil/client/builder.rb
evil-client-3.1.0 lib/evil/client/builder.rb
evil-client-3.0.4 lib/evil/client/builder.rb
evil-client-3.0.3 lib/evil/client/builder.rb
evil-client-3.0.2 lib/evil/client/builder.rb
evil-client-3.0.1 lib/evil/client/builder.rb
evil-client-3.0.0 lib/evil/client/builder.rb
evil-client-2.1.1 lib/evil/client/builder.rb
evil-client-2.1.0 lib/evil/client/builder.rb
evil-client-2.0.0 lib/evil/client/builder.rb
evil-client-1.1.0 lib/evil/client/builder.rb