Class: Commander

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommander

Returns a new instance of Commander.



4
5
6
# File 'lib/etvnet_seek/commander.rb', line 4

def initialize
  @options = parse_options
end

Instance Attribute Details

#modeObject

Returns the value of attribute mode.



2
3
4
# File 'lib/etvnet_seek/commander.rb', line 2

def mode
  @mode
end

Instance Method Details

#get_initial_modeObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/etvnet_seek/commander.rb', line 16

def get_initial_mode
  if @options[:search] or @options[:translit]
    'search'
  elsif @options[:best_hundred]
    'best_hundred'
  elsif @options[:top_this_week]
    'top_this_week'
  elsif @options[:channels]
    'channels'
  elsif @options[:catalog]
    'catalog'
  elsif @options[:new_items]
    'new_items'
  elsif @options[:premiere]
    'premiere'
  else
    'main'
  end
end

#search_mode?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/etvnet_seek/commander.rb', line 8

def search_mode?
  @options[:search]
end

#translit_mode?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/etvnet_seek/commander.rb', line 12

def translit_mode?
  @options[:translit]
end