class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/active_model/attribute_methods.rbs class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher def initialize: (prefix: String, suffix: String, parameters: false) -> void def method_name: (String attr_name) -> String end
:nodoc:
def initialize(prefix: "", suffix: "", parameters: nil)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (prefix: String, suffix: String, parameters: false) -> void
This signature was generated using 1 sample from 1 application.
def initialize(prefix: "", suffix: "", parameters: nil) @prefix = prefix @suffix = suffix @parameters = parameters.nil? ? FORWARD_PARAMETERS : parameters @regex = /\A(?:#{Regexp.escape(@prefix)})(.*)(?:#{Regexp.escape(@suffix)})\z/ @target = "#{@prefix}attribute#{@suffix}" @method_name = "#{prefix}%s#{suffix}" end
def match(method_name)
def match(method_name) if @regex =~ method_name AttributeMethodMatch.new(target, $1) end end
def method_name(attr_name)
Experimental RBS support (using type sampling data from the type_fusion
project).
def method_name: (String attr_name) -> String
This signature was generated using 110 samples from 2 applications.
def method_name(attr_name) @method_name % attr_name end