Class: WebForm
- Inherits:
-
Object
- Object
- WebForm
- Defined in:
- lib/key.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #find(name) ⇒ Object
-
#initialize(hash_) ⇒ WebForm
constructor
A new instance of WebForm.
Constructor Details
#initialize(hash_) ⇒ WebForm
Returns a new instance of WebForm.
24 25 26 |
# File 'lib/key.rb', line 24 def initialize(hash_) @notes_plain, @fields = hash_.values_at("notesPlain", "fields") end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
22 23 24 |
# File 'lib/key.rb', line 22 def fields @fields end |
Instance Method Details
#find(name) ⇒ Object
28 29 30 31 |
# File 'lib/key.rb', line 28 def find(name) field = @fields.select {|f| f["name"] == name || f["designation"] == name}.first field["value"] end |