Class: BlueStateDigital::SignupFormField
- Inherits:
-
ApiDataModel
- Object
- ApiDataModel
- BlueStateDigital::SignupFormField
- Defined in:
- lib/blue_state_digital/signup_form.rb
Constant Summary collapse
- FIELDS =
[:id, :format, :label, :description, :is_required, :is_custom_field, :cons_field_id, :create_dt]
Constants inherited from ApiDataModel
Instance Attribute Summary
Attributes inherited from ApiDataModel
Class Method Summary collapse
-
.from_xml(xml_record) ⇒ Object
Takes a <signup_form_field> block already processed by Nokogiri.
Methods inherited from ApiDataModel
Constructor Details
This class inherits a constructor from BlueStateDigital::ApiDataModel
Class Method Details
.from_xml(xml_record) ⇒ Object
Takes a <signup_form_field> block already processed by Nokogiri
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/blue_state_digital/signup_form.rb', line 7 def self.from_xml(xml_record) SignupFormField.new(id: xml_record[:id], format: xml_record.xpath('format').text, label: xml_record.xpath('label').text, description: xml_record.xpath('description').text, is_required: xml_record.xpath('is_required').text == '1', is_custom_field: xml_record.xpath('is_custom_field').text == '1', cons_field_id: xml_record.xpath('cons_field_id').text.to_i, create_dt: xml_record.xpath('create_dt').text) end |