Class: Tapioca::Dsl::Helpers::ActiveRecordColumnTypeHelper

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
RBIHelper
Defined in:
lib/tapioca/dsl/helpers/active_record_column_type_helper.rb

Constant Summary

Constants included from SorbetHelper

SorbetHelper::FEATURE_REQUIREMENTS, SorbetHelper::SORBET_BIN, SorbetHelper::SORBET_EXE_PATH_ENV_VAR, SorbetHelper::SORBET_GEM_SPEC, SorbetHelper::SORBET_PAYLOAD_URL, SorbetHelper::SPOOM_CONTEXT

Instance Method Summary collapse

Methods included from RBIHelper

#as_nilable_type, #create_block_param, #create_kw_opt_param, #create_kw_param, #create_kw_rest_param, #create_opt_param, #create_param, #create_rest_param, #create_typed_param, #sanitize_signature_types, serialize_type_variable, #valid_method_name?, #valid_parameter_name?

Methods included from SorbetHelper

#sorbet, #sorbet_path, #sorbet_supports?

Constructor Details

#initialize(constant) ⇒ ActiveRecordColumnTypeHelper

Returns a new instance of ActiveRecordColumnTypeHelper.



14
15
16
# File 'lib/tapioca/dsl/helpers/active_record_column_type_helper.rb', line 14

def initialize(constant)
  @constant = constant
end

Instance Method Details

#type_for(attribute_name, column_name = attribute_name) ⇒ Object



19
20
21
22
23
# File 'lib/tapioca/dsl/helpers/active_record_column_type_helper.rb', line 19

def type_for(attribute_name, column_name = attribute_name)
  return id_type if attribute_name == "id"

  column_type_for(column_name)
end