Sha256: 9b25a608843ef2f4c183703940f50aef606ceb7803f97254183139912792185f

Contents?: true

Size: 1.01 KB

Versions: 156

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Files
  class FormField
    attr_reader :options, :attributes

    def initialize(attributes = {}, options = {})
      @attributes = attributes || {}
      @options = options || {}
    end

    # int64 - Form field id
    def id
      @attributes[:id]
    end

    # string - Label to be displayed
    def label
      @attributes[:label]
    end

    # boolean - Is this a required field?
    def required
      @attributes[:required]
    end

    # string - Help text to be displayed
    def help_text
      @attributes[:help_text]
    end

    # string - Type of Field
    def field_type
      @attributes[:field_type]
    end

    # string - Options to display for radio and dropdown
    def options_for_select
      @attributes[:options_for_select]
    end

    # string - Default option for radio and dropdown
    def default_option
      @attributes[:default_option]
    end

    # int64 - Form field set id
    def form_field_set_id
      @attributes[:form_field_set_id]
    end
  end
end

Version data entries

156 entries across 156 versions & 1 rubygems

Version Path
files.com-1.0.283 lib/files.com/models/form_field.rb
files.com-1.0.282 lib/files.com/models/form_field.rb
files.com-1.0.281 lib/files.com/models/form_field.rb
files.com-1.0.280 lib/files.com/models/form_field.rb
files.com-1.0.279 lib/files.com/models/form_field.rb
files.com-1.0.278 lib/files.com/models/form_field.rb
files.com-1.0.277 lib/files.com/models/form_field.rb
files.com-1.0.276 lib/files.com/models/form_field.rb
files.com-1.0.275 lib/files.com/models/form_field.rb
files.com-1.0.274 lib/files.com/models/form_field.rb
files.com-1.0.273 lib/files.com/models/form_field.rb
files.com-1.0.272 lib/files.com/models/form_field.rb
files.com-1.0.271 lib/files.com/models/form_field.rb
files.com-1.0.270 lib/files.com/models/form_field.rb
files.com-1.0.269 lib/files.com/models/form_field.rb
files.com-1.0.268 lib/files.com/models/form_field.rb
files.com-1.0.267 lib/files.com/models/form_field.rb
files.com-1.0.266 lib/files.com/models/form_field.rb
files.com-1.0.265 lib/files.com/models/form_field.rb
files.com-1.0.264 lib/files.com/models/form_field.rb