Class: LinuxFortune::FortuneSource

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

Overview

fortune source

Instance Method Summary collapse

Instance Method Details

#fullpathObject

gets full path to the source



129
130
131
# File 'lib/linux_fortune.rb', line 129

def fullpath
  File.join(@path, @source)
end

#init(source = nil, path = "/usr/share/fortune", weight = nil) ⇒ Object



98
99
100
101
102
# File 'lib/linux_fortune.rb', line 98

def init(source = nil, path = "/usr/share/fortune", weight = nil )
  @source = source
  @path = path
  @weight = weight
end

#pathObject

gets the source path (directory with source)



110
111
112
# File 'lib/linux_fortune.rb', line 110

def path
  @path
end

#path=(srcpath) ⇒ Object

sets the fortune source path



105
106
107
# File 'lib/linux_fortune.rb', line 105

def path=(srcpath)
  @path = srcpath
end

#sourceObject

gets source file name



120
121
122
# File 'lib/linux_fortune.rb', line 120

def source
  @source
end

#source=(src) ⇒ Object

sets the source file name (file in FortuneSource.path)



115
116
117
# File 'lib/linux_fortune.rb', line 115

def source=(src)
  @source = src
end

#weightObject



124
125
126
# File 'lib/linux_fortune.rb', line 124

def weight
  @weight
end