Class: Treaty::Action::Request::Attribute::Builder

Inherits:
Entity::Attribute::Builder::Base show all
Defined in:
lib/treaty/action/request/attribute/builder.rb

Overview

DSL builder for defining request attributes.

Purpose

Provides Request-specific implementation of the attribute builder. Creates Request::Attribute::Attribute instances instead of generic ones.

Inheritance

Extends Treaty::Entity::Attribute::Builder::Base which provides:

  • DSL interface (string, integer, object, array, etc.)
  • method_missing magic for type-based method calls
  • Helper support (:required, :optional)
  • Entity reuse via use_entity

Usage

Used internally by:

  • Request::Attribute::Attribute (when processing nested object/array blocks)

DSL Example

request do
object :post do
  string :title, :required
  string :content
  array :tags do
    string :_self
  end
end
end

Methods

Implements abstract methods from base class:

  • create_attribute - Creates Request::Attribute::Attribute
  • deep_copy_attribute - Deep copies attribute for use_entity support

Instance Attribute Summary

Attributes inherited from Entity::Attribute::Builder::Base

#collection_of_attributes, #nesting_level

Method Summary

Methods inherited from Entity::Attribute::Builder::Base

#attribute, #initialize, #method_missing, #respond_to_missing?, #use_entity

Constructor Details

This class inherits a constructor from Treaty::Entity::Attribute::Builder::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Treaty::Entity::Attribute::Builder::Base