Class: Smartfm::List::Application

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

Constant Summary collapse

ATTRIBUTES =
[:application, :available, :progress, :list_id, :lang]

Instance Method Summary collapse

Methods inherited from Base

attributes, #attributes

Constructor Details

#initialize(params = {}) ⇒ Application

Returns a new instance of Application.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/smartfm/models/list.rb', line 19

def initialize(params = {})
  @application = case
    when params[:iknow]      then :iknow
    when params[:dictation]  then :dictation
    when params[:brainspeed] then :brainspeed
    end
  @available = params[self.application][:available]
  @progress  = params[self.application][:progress]
  @href      = params[self.application][:href]
  @list_id   = params[:list_id]
  @lang      = params[:lang]
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/smartfm/models/list.rb', line 32

def available?
  self.available
end