Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
trycourier (6.4.1)
trycourier (6.4.2)
cgi
connection_pool

Expand Down
20 changes: 10 additions & 10 deletions lib/courier/models/elemental_text_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
module Courier
module Models
class ElementalTextNode < Courier::Models::ElementalBaseNode
# @!attribute content
# The text content displayed in the notification. Either this field must be
# specified, or the elements field
#
# @return [String]
required :content, String

# @!attribute align
# Text alignment.
#
Expand All @@ -28,6 +21,13 @@ class ElementalTextNode < Courier::Models::ElementalBaseNode
# @return [String, nil]
optional :color, String, nil?: true

# @!attribute content
# The text content displayed in the notification. Either this field must be
# specified, or the elements field
#
# @return [String, nil]
optional :content, String

# @!attribute font_size
# CSS px font size for this text block, e.g. `16px`. Overrides the size of the
# `text_style` preset. Email only.
Expand Down Expand Up @@ -79,20 +79,20 @@ class ElementalTextNode < Courier::Models::ElementalBaseNode
# @return [String, nil]
optional :underline, String, nil?: true

# @!method initialize(content:, align: nil, bold: nil, color: nil, font_size: nil, format_: nil, italic: nil, line_height: nil, locales: nil, strikethrough: nil, text_style: nil, underline: nil)
# @!method initialize(align: nil, bold: nil, color: nil, content: nil, font_size: nil, format_: nil, italic: nil, line_height: nil, locales: nil, strikethrough: nil, text_style: nil, underline: nil)
# Some parameter documentations has been truncated, see
# {Courier::Models::ElementalTextNode} for more details.
#
# Represents a body of text to be rendered inside of the notification.
#
# @param content [String] The text content displayed in the notification. Either this
#
# @param align [Symbol, Courier::Models::ElementalTextNode::Align] Text alignment.
#
# @param bold [String, nil] Apply bold to the text
#
# @param color [String, nil] Specifies the color of text. Can be any valid css color value
#
# @param content [String] The text content displayed in the notification. Either this
#
# @param font_size [String, nil] CSS px font size for this text block, e.g. `16px`. Overrides the size of the `te
#
# @param format_ [Symbol, Courier::Models::ElementalTextNode::Format, nil]
Expand Down
23 changes: 13 additions & 10 deletions rbi/courier/models/elemental_text_node.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ module Courier
T.any(Courier::ElementalTextNode, Courier::Internal::AnyHash)
end

# The text content displayed in the notification. Either this field must be
# specified, or the elements field
sig { returns(String) }
attr_accessor :content

# Text alignment.
sig { returns(T.nilable(Courier::ElementalTextNode::Align::OrSymbol)) }
attr_reader :align
Expand All @@ -28,6 +23,14 @@ module Courier
sig { returns(T.nilable(String)) }
attr_accessor :color

# The text content displayed in the notification. Either this field must be
# specified, or the elements field
sig { returns(T.nilable(String)) }
attr_reader :content

sig { params(content: String).void }
attr_writer :content

# CSS px font size for this text block, e.g. `16px`. Overrides the size of the
# `text_style` preset. Email only.
sig { returns(T.nilable(String)) }
Expand Down Expand Up @@ -66,10 +69,10 @@ module Courier
# Represents a body of text to be rendered inside of the notification.
sig do
params(
content: String,
align: Courier::ElementalTextNode::Align::OrSymbol,
bold: T.nilable(String),
color: T.nilable(String),
content: String,
font_size: T.nilable(String),
format_: T.nilable(Courier::ElementalTextNode::Format::OrSymbol),
italic: T.nilable(String),
Expand All @@ -81,15 +84,15 @@ module Courier
).returns(T.attached_class)
end
def self.new(
# The text content displayed in the notification. Either this field must be
# specified, or the elements field
content:,
# Text alignment.
align: nil,
# Apply bold to the text
bold: nil,
# Specifies the color of text. Can be any valid css color value
color: nil,
# The text content displayed in the notification. Either this field must be
# specified, or the elements field
content: nil,
# CSS px font size for this text block, e.g. `16px`. Overrides the size of the
# `text_style` preset. Email only.
font_size: nil,
Expand All @@ -115,10 +118,10 @@ module Courier
sig do
override.returns(
{
content: String,
align: Courier::ElementalTextNode::Align::OrSymbol,
bold: T.nilable(String),
color: T.nilable(String),
content: String,
font_size: T.nilable(String),
format_: T.nilable(Courier::ElementalTextNode::Format::OrSymbol),
italic: T.nilable(String),
Expand Down
14 changes: 7 additions & 7 deletions sig/courier/models/elemental_text_node.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module Courier
module Models
type elemental_text_node =
{
content: String,
align: Courier::Models::ElementalTextNode::align,
bold: String?,
color: String?,
content: String,
font_size: String?,
format_: Courier::Models::ElementalTextNode::format_?,
italic: String?,
Expand All @@ -17,10 +17,6 @@ module Courier
}

class ElementalTextNode < Courier::Models::ElementalBaseNode
def content: -> String

def content=: (String _) -> String

def align: -> Courier::Models::ElementalTextNode::align?

def align=: (
Expand All @@ -35,6 +31,10 @@ module Courier

def color=: (String? _) -> String?

def content: -> String?

def content=: (String _) -> String

def font_size: -> String?

def font_size=: (String? _) -> String?
Expand Down Expand Up @@ -72,10 +72,10 @@ module Courier
def underline=: (String? _) -> String?

def initialize: (
content: String,
?align: Courier::Models::ElementalTextNode::align,
?bold: String?,
?color: String?,
?content: String,
?font_size: String?,
?format_: Courier::Models::ElementalTextNode::format_?,
?italic: String?,
Expand All @@ -87,10 +87,10 @@ module Courier
) -> void

def to_hash: -> {
content: String,
align: Courier::Models::ElementalTextNode::align,
bold: String?,
color: String?,
content: String,
font_size: String?,
format_: Courier::Models::ElementalTextNode::format_?,
italic: String?,
Expand Down