Class: UserSelection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



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

def index
  @index
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/etvnet_seek/user_selection.rb', line 18

def blank?
  @blank
end

#catalog?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/etvnet_seek/user_selection.rb', line 22

def catalog?
  @catalog
end

#parse(text) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/etvnet_seek/user_selection.rb', line 4

def parse text
  @blank = text.strip.size == 0

  result = text.split

  @index = result[0].to_i-1
  @quit = (result & ['q', 'Q']).empty? ? false : true
  @catalog = (result & ['c', 'C']).empty? ? false : true
end

#quit?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/etvnet_seek/user_selection.rb', line 14

def quit?
  @quit
end