Class: LinuxFortune::FortuneSource
- Inherits:
-
Object
- Object
- LinuxFortune::FortuneSource
- Defined in:
- lib/linux_fortune.rb
Overview
fortune source
Instance Method Summary collapse
-
#fullpath ⇒ Object
gets full path to the source.
- #init(source = nil, path = "/usr/share/fortune", weight = nil) ⇒ Object
-
#path ⇒ Object
gets the source path (directory with source).
-
#path=(srcpath) ⇒ Object
sets the fortune source path.
-
#source ⇒ Object
gets source file name.
-
#source=(src) ⇒ Object
sets the source file name (file in FortuneSource.path).
- #weight ⇒ Object
Instance Method Details
#fullpath ⇒ Object
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 |
#path ⇒ Object
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 |
#source ⇒ Object
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 |
#weight ⇒ Object
124 125 126 |
# File 'lib/linux_fortune.rb', line 124 def weight @weight end |