Class: Rubycord::Components::TextInput

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#custom_idString (readonly)

Returns:



178
179
180
# File 'lib/rubycord/data/component.rb', line 178

def custom_id
  @custom_id
end

#labelString (readonly)

Returns:



184
185
186
# File 'lib/rubycord/data/component.rb', line 184

def label
  @label
end

#max_lengthInteger? (readonly)

Returns:



190
191
192
# File 'lib/rubycord/data/component.rb', line 190

def max_length
  @max_length
end

#min_lengthInteger? (readonly)

Returns:



187
188
189
# File 'lib/rubycord/data/component.rb', line 187

def min_length
  @min_length
end

#placeholderString? (readonly)

Returns:



199
200
201
# File 'lib/rubycord/data/component.rb', line 199

def placeholder
  @placeholder
end

#requiredtrue, false (readonly)

Returns:

  • (true, false)


193
194
195
# File 'lib/rubycord/data/component.rb', line 193

def required
  @required
end

#styleSymbol (readonly)

Returns:

  • (Symbol)


181
182
183
# File 'lib/rubycord/data/component.rb', line 181

def style
  @style
end

#valueString? (readonly)

Returns:



196
197
198
# File 'lib/rubycord/data/component.rb', line 196

def value
  @value
end

Instance Method Details

#paragraph?Boolean

Returns:

  • (Boolean)


218
219
220
# File 'lib/rubycord/data/component.rb', line 218

def paragraph?
  @style == :paragraph
end

#required?Boolean

Returns:

  • (Boolean)


222
223
224
# File 'lib/rubycord/data/component.rb', line 222

def required?
  @required
end

#short?Boolean

Returns:

  • (Boolean)


214
215
216
# File 'lib/rubycord/data/component.rb', line 214

def short?
  @style == :short
end