Class: MxitRails::Descriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/mxit_rails/descriptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, action, parent = nil) ⇒ Descriptor

Returns a new instance of Descriptor.



27
28
29
30
31
32
33
# File 'lib/mxit_rails/descriptor.rb', line 27

def initialize name, action, parent=nil
  @parent_descriptor = parent
  @name = name.to_sym
  @action = action.to_sym
  @validations = []
  @steps = []
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



6
7
8
# File 'lib/mxit_rails/descriptor.rb', line 6

def action
  @action
end

#has_tableObject

Returns the value of attribute has_table.



22
23
24
# File 'lib/mxit_rails/descriptor.rb', line 22

def has_table
  @has_table
end

#inputObject

Returns the value of attribute input.



11
12
13
# File 'lib/mxit_rails/descriptor.rb', line 11

def input
  @input
end

#input_labelObject

Returns the value of attribute input_label.



12
13
14
# File 'lib/mxit_rails/descriptor.rb', line 12

def input_label
  @input_label
end

#multi_selectObject

Returns the value of attribute multi_select.



18
19
20
# File 'lib/mxit_rails/descriptor.rb', line 18

def multi_select
  @multi_select
end

#multi_select_nextObject

Returns the value of attribute multi_select_next.



19
20
21
# File 'lib/mxit_rails/descriptor.rb', line 19

def multi_select_next
  @multi_select_next
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/mxit_rails/descriptor.rb', line 5

def name
  @name
end

#numbered_listObject

Returns the value of attribute numbered_list.



20
21
22
# File 'lib/mxit_rails/descriptor.rb', line 20

def numbered_list
  @numbered_list
end

#parent_descriptorObject

Returns the value of attribute parent_descriptor.



3
4
5
# File 'lib/mxit_rails/descriptor.rb', line 3

def parent_descriptor
  @parent_descriptor
end

#proceedObject

Returns the value of attribute proceed.



9
10
11
# File 'lib/mxit_rails/descriptor.rb', line 9

def proceed
  @proceed
end

#selectObject

Returns the value of attribute select.



14
15
16
# File 'lib/mxit_rails/descriptor.rb', line 14

def select
  @select
end

#select_labelObject

Returns the value of attribute select_label.



15
16
17
# File 'lib/mxit_rails/descriptor.rb', line 15

def select_label
  @select_label
end

#select_optionsObject

Returns the value of attribute select_options.



16
17
18
# File 'lib/mxit_rails/descriptor.rb', line 16

def select_options
  @select_options
end

#selectedObject

Returns the value of attribute selected.



17
18
19
# File 'lib/mxit_rails/descriptor.rb', line 17

def selected
  @selected
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/mxit_rails/descriptor.rb', line 7

def type
  @type
end

#validatedObject

Returns the value of attribute validated.



25
26
27
# File 'lib/mxit_rails/descriptor.rb', line 25

def validated
  @validated
end

#validations_failedObject

Returns the value of attribute validations_failed.



24
25
26
# File 'lib/mxit_rails/descriptor.rb', line 24

def validations_failed
  @validations_failed
end

Instance Method Details

#form?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/mxit_rails/descriptor.rb', line 35

def form?
  type == :form
end