Class: Rubycord::Components::TextInput
- Inherits:
-
Object
- Object
- Rubycord::Components::TextInput
- Defined in:
- lib/rubycord/data/component.rb
Overview
Text input component for use in modals. Can be either a line (short
), or a multi line (paragraph
) block.
Constant Summary collapse
- SHORT =
Single line text input
-
1
- PARAGRAPH =
Multi-line text input
-
2
Instance Attribute Summary collapse
- #custom_id ⇒ String readonly
- #label ⇒ String readonly
- #max_length ⇒ Integer? readonly
- #min_length ⇒ Integer? readonly
- #placeholder ⇒ String? readonly
- #required ⇒ true, false readonly
- #style ⇒ Symbol readonly
- #value ⇒ String? readonly
Instance Method Summary collapse
Instance Attribute Details
#custom_id ⇒ String (readonly)
178 179 180 |
# File 'lib/rubycord/data/component.rb', line 178 def custom_id @custom_id end |
#label ⇒ String (readonly)
184 185 186 |
# File 'lib/rubycord/data/component.rb', line 184 def label @label end |
#max_length ⇒ Integer? (readonly)
190 191 192 |
# File 'lib/rubycord/data/component.rb', line 190 def max_length @max_length end |
#min_length ⇒ Integer? (readonly)
187 188 189 |
# File 'lib/rubycord/data/component.rb', line 187 def min_length @min_length end |
#placeholder ⇒ String? (readonly)
199 200 201 |
# File 'lib/rubycord/data/component.rb', line 199 def placeholder @placeholder end |
#required ⇒ true, false (readonly)
193 194 195 |
# File 'lib/rubycord/data/component.rb', line 193 def required @required end |
#style ⇒ Symbol (readonly)
181 182 183 |
# File 'lib/rubycord/data/component.rb', line 181 def style @style end |
#value ⇒ String? (readonly)
196 197 198 |
# File 'lib/rubycord/data/component.rb', line 196 def value @value end |
Instance Method Details
#paragraph? ⇒ Boolean
218 219 220 |
# File 'lib/rubycord/data/component.rb', line 218 def paragraph? @style == :paragraph end |
#required? ⇒ Boolean
222 223 224 |
# File 'lib/rubycord/data/component.rb', line 222 def required? @required end |
#short? ⇒ Boolean
214 215 216 |
# File 'lib/rubycord/data/component.rb', line 214 def short? @style == :short end |