Class: Files::FormField
- Inherits:
-
Object
- Object
- Files::FormField
- Defined in:
- lib/files.com/models/form_field.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#default_option ⇒ Object
string - Default option for radio and dropdown.
-
#field_type ⇒ Object
string - Type of Field.
-
#form_field_set_id ⇒ Object
int64 - Form field set id.
-
#help_text ⇒ Object
string - Help text to be displayed.
-
#id ⇒ Object
int64 - Form field id.
-
#initialize(attributes = {}, options = {}) ⇒ FormField
constructor
A new instance of FormField.
-
#label ⇒ Object
string - Label to be displayed.
-
#options_for_select ⇒ Object
array(string) - Options to display for radio and dropdown.
-
#required ⇒ Object
boolean - Is this a required field?.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ FormField
Returns a new instance of FormField.
7 8 9 10 |
# File 'lib/files.com/models/form_field.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/form_field.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/form_field.rb', line 5 def @options end |
Instance Method Details
#default_option ⇒ Object
string - Default option for radio and dropdown
43 44 45 |
# File 'lib/files.com/models/form_field.rb', line 43 def default_option @attributes[:default_option] end |
#field_type ⇒ Object
string - Type of Field
33 34 35 |
# File 'lib/files.com/models/form_field.rb', line 33 def field_type @attributes[:field_type] end |
#form_field_set_id ⇒ Object
int64 - Form field set id
48 49 50 |
# File 'lib/files.com/models/form_field.rb', line 48 def form_field_set_id @attributes[:form_field_set_id] end |
#help_text ⇒ Object
string - Help text to be displayed
28 29 30 |
# File 'lib/files.com/models/form_field.rb', line 28 def help_text @attributes[:help_text] end |
#id ⇒ Object
int64 - Form field id
13 14 15 |
# File 'lib/files.com/models/form_field.rb', line 13 def id @attributes[:id] end |
#label ⇒ Object
string - Label to be displayed
18 19 20 |
# File 'lib/files.com/models/form_field.rb', line 18 def label @attributes[:label] end |
#options_for_select ⇒ Object
array(string) - Options to display for radio and dropdown
38 39 40 |
# File 'lib/files.com/models/form_field.rb', line 38 def @attributes[:options_for_select] end |
#required ⇒ Object
boolean - Is this a required field?
23 24 25 |
# File 'lib/files.com/models/form_field.rb', line 23 def required @attributes[:required] end |