Class: Reader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReader

Returns a new instance of Reader.



5
6
7
8
9
# File 'lib/read_config.rb', line 5

def initialize
  @path = ["/bin"]
  @prompt = "$ "
  @color = {"prompt" => 'white', "great" => 'red', "miss" => 'blue'}
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



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

def color
  @color
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#promptObject (readonly)

Returns the value of attribute prompt.



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

def prompt
  @prompt
end

Instance Method Details

#setcolor(arg1, arg2) ⇒ Object



23
24
25
# File 'lib/read_config.rb', line 23

def setcolor(arg1, arg2)
  @color[arg1] = arg2
end

#setpath(str) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/read_config.rb', line 11

def setpath(str)
  if str.index(':')
    @path = str.split(':')
  else
    @path = [str]
  end
end

#setprompt(str) ⇒ Object



19
20
21
# File 'lib/read_config.rb', line 19

def setprompt(str)
  @prompt = str
end