Class: Mailkube::Attachment
- Inherits:
-
Object
- Object
- Mailkube::Attachment
- Defined in:
- lib/mailkube/types.rb,
sig/mailkube/types.rbs
Overview
Response and parameter models.
Two shapes matter here, and both were arrived at by testing Steep 2.0.0 rather than guessing.
In lib/, each model is class X < Data.define(...), not X = Data.define(...) do ... end.
Steep attributes the block form's methods to the enclosing module rather than to the constant,
and then cannot resolve the generated readers from inside them.
Here, each is declared as a plain class X and does not name ::Data as its superclass.
Inheriting ::Data in the signature brings its own untyped new along, which shadows the
keyword-argument initialize below, and every call site then fails with "unexpected keyword
argument".
The generated readers are declared as attr_reader; Ruby::MethodDefinitionMissing stays off
in the Steepfile because Steep cannot see their implementations.
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Returns the value of attribute content.
-
#content_type ⇒ String?
readonly
Returns the value of attribute content_type.
-
#filename ⇒ String
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename:, content:, content_type: nil) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(filename:, content:, content_type: nil) ⇒ Attachment
Returns a new instance of Attachment.
12 |
# File 'lib/mailkube/types.rb', line 12 def initialize(filename:, content:, content_type: nil) = super |
Instance Attribute Details
#content ⇒ String (readonly)
Returns the value of attribute content.
19 20 21 |
# File 'sig/mailkube/types.rbs', line 19 def content @content end |
#content_type ⇒ String? (readonly)
Returns the value of attribute content_type.
20 21 22 |
# File 'sig/mailkube/types.rbs', line 20 def content_type @content_type end |
#filename ⇒ String (readonly)
Returns the value of attribute filename.
18 19 20 |
# File 'sig/mailkube/types.rbs', line 18 def filename @filename end |