Sha256: 12ae3185ef0edeeaf495eab4ee402b460c698f91abba232fbe0d968f16de16a2

Contents?: true

Size: 1.01 KB

Versions: 279

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

    # array - 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

279 entries across 279 versions & 1 rubygems

Version Path
files.com-1.1.66 lib/files.com/models/form_field.rb
files.com-1.1.65 lib/files.com/models/form_field.rb
files.com-1.1.64 lib/files.com/models/form_field.rb
files.com-1.1.63 lib/files.com/models/form_field.rb
files.com-1.1.62 lib/files.com/models/form_field.rb
files.com-1.1.61 lib/files.com/models/form_field.rb
files.com-1.1.60 lib/files.com/models/form_field.rb
files.com-1.1.59 lib/files.com/models/form_field.rb
files.com-1.1.58 lib/files.com/models/form_field.rb
files.com-1.1.57 lib/files.com/models/form_field.rb
files.com-1.1.56 lib/files.com/models/form_field.rb
files.com-1.1.55 lib/files.com/models/form_field.rb
files.com-1.1.54 lib/files.com/models/form_field.rb
files.com-1.1.53 lib/files.com/models/form_field.rb
files.com-1.1.52 lib/files.com/models/form_field.rb
files.com-1.1.51 lib/files.com/models/form_field.rb
files.com-1.1.50 lib/files.com/models/form_field.rb
files.com-1.1.49 lib/files.com/models/form_field.rb
files.com-1.1.48 lib/files.com/models/form_field.rb
files.com-1.1.47 lib/files.com/models/form_field.rb