Class: OpenRosa::Fields::Select1

Inherits:
Base
  • Object
show all
Defined in:
lib/open_rosa/fields/select1.rb

Overview

Single select field (radio buttons or dropdown) Maps to XForms element

Instance Attribute Summary collapse

Attributes inherited from Base

#default, #hint, #label, #name, #required

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Select1

Returns a new instance of Select1.



10
11
12
13
14
15
16
# File 'lib/open_rosa/fields/select1.rb', line 10

def initialize(name, options = {})
  super
  @choices = options[:choices]
  @appearance = options[:appearance]

  validate!
end

Instance Attribute Details

#appearanceObject (readonly)

Returns the value of attribute appearance.



8
9
10
# File 'lib/open_rosa/fields/select1.rb', line 8

def appearance
  @appearance
end

#choicesObject (readonly)

Returns the value of attribute choices.



8
9
10
# File 'lib/open_rosa/fields/select1.rb', line 8

def choices
  @choices
end