# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `smart_properties` gem. # Please instead update this file by running `bin/tapioca gem smart_properties`. # {SmartProperties} can be used to easily build more full-fledged accessors # for standard Ruby classes. In contrast to regular accessors, # {SmartProperties} support validation and conversion of input data, as well # as, the specification of default values. Additionally, individual # {SmartProperties} can be marked as required. This causes the runtime to # throw an +ArgumentError+ whenever a required property has not been # specified. # # In order to use {SmartProperties}, simply include the {SmartProperties} # module and use the {ClassMethods#property} method to define properties. # # @example Definition of a property that makes use of all {SmartProperties} features. # # property :language_code, :accepts => [:de, :en], # :converts => :to_sym, # :default => :de, # :required => true # @see ClassMethods#property More information on how to configure properties # # source://smart_properties//lib/smart_properties.rb#23 module SmartProperties mixes_in_class_methods ::SmartProperties::ClassMethods # Implements a key-value enabled constructor that acts as default # constructor for all {SmartProperties}-enabled classes. Positional arguments # or keyword arguments that do not correspond to a property are forwarded to # the super class constructor. # # @param attrs [Hash] the set of attributes that is used for initialization # @raise [SmartProperties::ConstructorArgumentForwardingError] when unknown arguments were supplied that could not be processed by the super class initializer either. # @raise [SmartProperties::InitializationError] when incorrect values were supplied or required values weren't been supplied. # # source://smart_properties//lib/smart_properties.rb#127 def initialize(*args, &block); end # source://smart_properties//lib/smart_properties.rb#165 def [](name); end # source://smart_properties//lib/smart_properties.rb#172 def []=(name, value); end class << self private # Extends the class, which this module is included in, with a property # method to define properties. # # @param base [Class] the class this module is included in # # source://smart_properties//lib/smart_properties.rb#110 def included(base); end end end # source://smart_properties//lib/smart_properties/errors.rb#5 class SmartProperties::AssignmentError < ::SmartProperties::Error # @return [AssignmentError] a new instance of AssignmentError # # source://smart_properties//lib/smart_properties/errors.rb#9 def initialize(sender, property, message); end # Returns the value of attribute property. # # source://smart_properties//lib/smart_properties/errors.rb#7 def property; end # Sets the attribute property # # @param value the value to set the attribute property to. # # source://smart_properties//lib/smart_properties/errors.rb#7 def property=(_arg0); end # Returns the value of attribute sender. # # source://smart_properties//lib/smart_properties/errors.rb#6 def sender; end # Sets the attribute sender # # @param value the value to set the attribute sender to. # # source://smart_properties//lib/smart_properties/errors.rb#6 def sender=(_arg0); end end # source://smart_properties//lib/smart_properties.rb#24 module SmartProperties::ClassMethods # Returns a class's smart properties. This includes the properties that # have been defined in the parent classes. # # @return [Hash] A map of property names to property instances. # # source://smart_properties//lib/smart_properties.rb#31 def properties; end protected # Defines a new property from a name and a set of options. This results # results in creating an accessor that has additional features: # # 1. Validation of input data by specifiying the +:accepts+ option: # If you use a class as value for this option, the setter will check # if the value it is about to assign is of this type. If you use an # array, the setter will check if the value it is about to assign is # included in this array. Finally, if you specify a block, it will # invoke the block with the value it is about to assign and check if # the block returns a thruthy value, meaning anything but +false+ and # +nil+. # # 2. Conversion of input data by specifiying the +:converts+ option: # If you use provide a symbol as value for this option, the setter will # invoke this method on the object it is about to assign and take the # result of this call instead. If you provide a block, it will invoke # the block with the value it is about to assign and take the result # of the block instead. # # 3. Providing a default value by specifiying the +:default+ option. # # 4. Forcing a property to be present by setting the +:required+ option # to true. # # @example Definition of a property that makes use of all {SmartProperties} features. # # property :language_code, :accepts => [:de, :en], # :converts => :to_sym, # :default => :de, # :required => true # @option options # @option options # @option options # @option options # @param name [Symbol] the name of the property # @param options [Hash] the list of options used to configure the property # @return [Property] The defined property. # # source://smart_properties//lib/smart_properties.rb#82 def property(name, **options); end # source://smart_properties//lib/smart_properties.rb#87 def property!(name, **options); end end # source://smart_properties//lib/smart_properties/errors.rb#3 class SmartProperties::ConfigurationError < ::SmartProperties::Error; end # source://smart_properties//lib/smart_properties/errors.rb#16 class SmartProperties::ConstructorArgumentForwardingError < ::SmartProperties::Error # @return [ConstructorArgumentForwardingError] a new instance of ConstructorArgumentForwardingError # # source://smart_properties//lib/smart_properties/errors.rb#17 def initialize(positional_arguments, keyword_arguments); end private # source://smart_properties//lib/smart_properties/errors.rb#33 def generate_description(argument_type, argument_number); end end # source://smart_properties//lib/smart_properties/errors.rb#2 class SmartProperties::Error < ::ArgumentError; end # source://smart_properties//lib/smart_properties/errors.rb#95 class SmartProperties::InitializationError < ::SmartProperties::Error # @return [InitializationError] a new instance of InitializationError # # source://smart_properties//lib/smart_properties/errors.rb#99 def initialize(sender, properties); end # Returns the value of attribute properties. # # source://smart_properties//lib/smart_properties/errors.rb#97 def properties; end # Sets the attribute properties # # @param value the value to set the attribute properties to. # # source://smart_properties//lib/smart_properties/errors.rb#97 def properties=(_arg0); end # Returns the value of attribute sender. # # source://smart_properties//lib/smart_properties/errors.rb#96 def sender; end # Sets the attribute sender # # @param value the value to set the attribute sender to. # # source://smart_properties//lib/smart_properties/errors.rb#96 def sender=(_arg0); end # source://smart_properties//lib/smart_properties/errors.rb#110 def to_hash; end end # source://smart_properties//lib/smart_properties/errors.rb#62 class SmartProperties::InvalidValueError < ::SmartProperties::AssignmentError # @return [InvalidValueError] a new instance of InvalidValueError # # source://smart_properties//lib/smart_properties/errors.rb#65 def initialize(sender, property, value); end # source://smart_properties//lib/smart_properties/errors.rb#80 def to_hash; end # Returns the value of attribute value. # # source://smart_properties//lib/smart_properties/errors.rb#63 def value; end # Sets the attribute value # # @param value the value to set the attribute value to. # # source://smart_properties//lib/smart_properties/errors.rb#63 def value=(_arg0); end private # source://smart_properties//lib/smart_properties/errors.rb#86 def accepter_message(sender, property); end end # source://smart_properties//lib/smart_properties/errors.rb#45 class SmartProperties::MissingValueError < ::SmartProperties::AssignmentError # @return [MissingValueError] a new instance of MissingValueError # # source://smart_properties//lib/smart_properties/errors.rb#46 def initialize(sender, property); end # source://smart_properties//lib/smart_properties/errors.rb#57 def to_hash; end end # source://smart_properties//lib/smart_properties.rb#94 module SmartProperties::ModuleMethods # source://smart_properties//lib/smart_properties.rb#95 def included(target); end end # source://smart_properties//lib/smart_properties/property.rb#2 class SmartProperties::Property # @return [Property] a new instance of Property # # source://smart_properties//lib/smart_properties/property.rb#17 def initialize(name, **attrs); end # Returns the value of attribute accepter. # # source://smart_properties//lib/smart_properties/property.rb#8 def accepter; end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#78 def accepts?(value, scope); end # source://smart_properties//lib/smart_properties/property.rb#62 def convert(scope, value); end # Returns the value of attribute converter. # # source://smart_properties//lib/smart_properties/property.rb#7 def converter; end # source://smart_properties//lib/smart_properties/property.rb#74 def default(scope); end # source://smart_properties//lib/smart_properties/property.rb#98 def define(klass); end # source://smart_properties//lib/smart_properties/property.rb#136 def get(scope); end # Returns the value of attribute instance_variable_name. # # source://smart_properties//lib/smart_properties/property.rb#10 def instance_variable_name; end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#49 def missing?(scope); end # Returns the value of attribute name. # # source://smart_properties//lib/smart_properties/property.rb#6 def name; end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#45 def optional?(scope); end # @raise [MissingValueError] # # source://smart_properties//lib/smart_properties/property.rb#89 def prepare(scope, value); end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#53 def present?(scope); end # Returns the value of attribute reader. # # source://smart_properties//lib/smart_properties/property.rb#9 def reader; end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#41 def required?(scope); end # source://smart_properties//lib/smart_properties/property.rb#122 def set(scope, value); end # source://smart_properties//lib/smart_properties/property.rb#126 def set_default(scope); end # source://smart_properties//lib/smart_properties/property.rb#141 def to_h; end # Returns the value of attribute writable. # # source://smart_properties//lib/smart_properties/property.rb#11 def writable; end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#57 def writable?; end private # @return [Boolean] # # source://smart_properties//lib/smart_properties/property.rb#155 def null_object?(object); end class << self # source://smart_properties//lib/smart_properties/property.rb#13 def define(scope, name, **options); end end end # source://smart_properties//lib/smart_properties/property.rb#4 SmartProperties::Property::ALLOWED_DEFAULT_CLASSES = T.let(T.unsafe(nil), Array) # source://smart_properties//lib/smart_properties/property.rb#3 SmartProperties::Property::MODULE_REFERENCE = T.let(T.unsafe(nil), Symbol) # source://smart_properties//lib/smart_properties/property_collection.rb#2 class SmartProperties::PropertyCollection include ::Enumerable # @return [PropertyCollection] a new instance of PropertyCollection # # source://smart_properties//lib/smart_properties/property_collection.rb#23 def initialize; end # source://smart_properties//lib/smart_properties/property_collection.rb#37 def [](name); end # source://smart_properties//lib/smart_properties/property_collection.rb#29 def []=(name, value); end # source://smart_properties//lib/smart_properties/property_collection.rb#53 def each(&block); end # @return [Boolean] # # source://smart_properties//lib/smart_properties/property_collection.rb#41 def key?(name); end # source://smart_properties//lib/smart_properties/property_collection.rb#45 def keys; end # Returns the value of attribute parent. # # source://smart_properties//lib/smart_properties/property_collection.rb#5 def parent; end # source://smart_properties//lib/smart_properties/property_collection.rb#62 def register(child); end # source://smart_properties//lib/smart_properties/property_collection.rb#58 def to_hash; end # source://smart_properties//lib/smart_properties/property_collection.rb#49 def values; end protected # Returns the value of attribute children. # # source://smart_properties//lib/smart_properties/property_collection.rb#70 def children; end # Sets the attribute children # # @param value the value to set the attribute children to. # # source://smart_properties//lib/smart_properties/property_collection.rb#70 def children=(_arg0); end # Returns the value of attribute collection. # # source://smart_properties//lib/smart_properties/property_collection.rb#71 def collection; end # Sets the attribute collection # # @param value the value to set the attribute collection to. # # source://smart_properties//lib/smart_properties/property_collection.rb#71 def collection=(_arg0); end # Returns the value of attribute collection_with_parent_collection. # # source://smart_properties//lib/smart_properties/property_collection.rb#72 def collection_with_parent_collection; end # Sets the attribute collection_with_parent_collection # # @param value the value to set the attribute collection_with_parent_collection to. # # source://smart_properties//lib/smart_properties/property_collection.rb#72 def collection_with_parent_collection=(_arg0); end # source://smart_properties//lib/smart_properties/property_collection.rb#74 def notify_children; end # source://smart_properties//lib/smart_properties/property_collection.rb#78 def refresh(parent_collection); end class << self # source://smart_properties//lib/smart_properties/property_collection.rb#7 def for(scope); end end end # source://smart_properties//lib/smart_properties/version.rb#2 SmartProperties::VERSION = T.let(T.unsafe(nil), String) # source://smart_properties//lib/smart_properties/validations.rb#4 module SmartProperties::Validations; end # source://smart_properties//lib/smart_properties/validations/ancestor.rb#4 class SmartProperties::Validations::Ancestor include ::SmartProperties extend ::SmartProperties::ClassMethods # source://smart_properties//lib/smart_properties/validations/ancestor.rb#13 def to_proc; end # source://smart_properties//lib/smart_properties/validations/ancestor.rb#18 def to_s; end # source://smart_properties//lib/smart_properties/validations/ancestor.rb#9 def validate(klass); end class << self def must_be(*_arg0); end end end