Class: WebForm

Inherits:
Object
  • Object
show all
Defined in:
lib/key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_) ⇒ WebForm

Returns a new instance of WebForm.



26
27
28
# File 'lib/key.rb', line 26

def initialize(hash_)
  @notes_plain, @fields = hash_.values_at("notesPlain", "fields")
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



24
25
26
# File 'lib/key.rb', line 24

def fields
  @fields
end

Instance Method Details

#find(name) ⇒ Object



30
31
32
33
# File 'lib/key.rb', line 30

def find(name)
  field = @fields.select {|f| f["name"] == name || f["designation"] == name}.first
  field["value"]
end