Class: Archsight::Web::Editor::FormBuilder::Field

Inherits:
Struct
  • Object
show all
Defined in:
lib/archsight/web/editor/form_builder.rb

Overview

Field represents a single form field configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#code_languageObject

Returns the value of attribute code_language

Returns:

  • (Object)

    the current value of code_language



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def code_language
  @code_language
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def description
  @description
end

#input_typeObject

Returns the value of attribute input_type

Returns:

  • (Object)

    the current value of input_type



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def input_type
  @input_type
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def key
  @key
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def options
  @options
end

#requiredObject

Returns the value of attribute required

Returns:

  • (Object)

    the current value of required



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def required
  @required
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def step
  @step
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



11
12
13
# File 'lib/archsight/web/editor/form_builder.rb', line 11

def title
  @title
end

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/archsight/web/editor/form_builder.rb', line 24

def code?
  input_type == :code
end

#list?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/archsight/web/editor/form_builder.rb', line 40

def list?
  input_type == :list
end

#markdown?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/archsight/web/editor/form_builder.rb', line 20

def markdown?
  input_type == :markdown
end

#number?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/archsight/web/editor/form_builder.rb', line 28

def number?
  input_type == :number
end

#select?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/archsight/web/editor/form_builder.rb', line 12

def select?
  input_type == :select
end

#text?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/archsight/web/editor/form_builder.rb', line 36

def text?
  input_type == :text
end

#textarea?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/archsight/web/editor/form_builder.rb', line 16

def textarea?
  %i[textarea markdown].include?(input_type)
end

#url?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/archsight/web/editor/form_builder.rb', line 32

def url?
  input_type == :url
end