module Spear::Structure::Application::EmbededClass

Public Instance Methods

generate_apps(apps) click to toggle source
# File lib/spear/structure/application/embeded_class.rb, line 44
def generate_apps(apps)
  if !apps.nil?
    if apps.kind_of?(Array)
      apps.map {|app|
        ApplicationObject.new(app['ApplicationDID'], app['Viewed'], app['ViewedDate'])
      }
    else # Hash
      [] << ApplicationObject.new(apps['ApplicationDID'], apps['Viewed'], apps['ViewedDate'])
    end
  else
    []
  end
end
generate_questions(questions) click to toggle source
# File lib/spear/structure/application/embeded_class.rb, line 19
def generate_questions(questions)
  if !questions.nil?
    if questions.kind_of?(Array)
      questions.map {|q|
        Question.new(q['QuestionID'], q['QuestionType'], q['IsRequired'], q['QuestionText'])
      }
    else # Hash
      [] << Question.new(questions['QuestionID'],
        questions['QuestionType'], questions['IsRequired'], questions['QuestionText'])
    end
  else
    []
  end
end