Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 621 Bytes

compiler_activemodelattributes.md

File metadata and controls

28 lines (20 loc) · 621 Bytes

ActiveModelAttributes

Tapioca::Dsl::Compilers::ActiveModelAttributes decorates RBI files for all classes that use ActiveModel::Attributes.

For example, with the following class:

class Shop
  include ActiveModel::Attributes

  attribute :name, :string
end

this compiler will produce an RBI file with the following content:

# typed: true

class Shop

  sig { returns(T.nilable(::String)) }
  def name; end

  sig { params(name: T.nilable(::String)).returns(T.nilable(::String)) }
  def name=(name); end
end