Class: Smartfm::User::Study

Inherits:
Base
  • Object
show all
Defined in:
lib/smartfm/models/user.rb

Defined Under Namespace

Classes: Result, TotalSummary

Constant Summary collapse

ATTRIBUTES =
[:today, :results, :total_summary]

Instance Method Summary collapse

Methods inherited from Base

attributes, #attributes

Constructor Details

#initialize(params = {}) ⇒ Study

Returns a new instance of Study.



59
60
61
62
63
# File 'lib/smartfm/models/user.rb', line 59

def initialize(params = {})
  @today         = (Date.parse(params[:today]) rescue nil)
  @results       = self.deserialize(params[:study_results], :as => Smartfm::User::Study::Result)
  @total_summary = self.deserialize(params[:total_summary], :as => Smartfm::User::Study::TotalSummary)
end