-
-
Save davidlesches/eefd0f0f27712e424c95 to your computer and use it in GitHub Desktop.
Yodlee and Rails Implementation, Part 3: Forms - app/models/yodlee/form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Yodlee | |
class Form | |
attr_reader :fields, :wrapper | |
def initialize opts | |
@fields = opts[:fields] | |
@wrapper = opts[:wrapper] | |
end | |
def render | |
fields.componentList.map do |element| | |
type = element.fieldType.typeName.downcase.classify | |
Yodlee::Fields.const_get(type).new(field: element, wrapper: wrapper).render | |
end.join('').squish | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment