Class: WRI::RiService
- Inherits:
-
Object
- Object
- WRI::RiService
- Defined in:
- lib/wri/ri_service.rb
Instance Attribute Summary collapse
-
#library ⇒ Object
readonly
Returns the value of attribute library.
Instance Method Summary collapse
- #info(keyword) ⇒ Object
-
#initialize(library = nil) ⇒ RiService
constructor
A new instance of RiService.
- #names ⇒ Object
Constructor Details
#initialize(library = nil) ⇒ RiService
Returns a new instance of RiService.
9 10 11 |
# File 'lib/wri/ri_service.rb', line 9 def initialize(library=nil) @library = library end |
Instance Attribute Details
#library ⇒ Object (readonly)
Returns the value of attribute library.
7 8 9 |
# File 'lib/wri/ri_service.rb', line 7 def library @library end |
Instance Method Details
#info(keyword) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/wri/ri_service.rb', line 13 def info(keyword) if library `ri -d #{library} -f html #{keyword}` else `ri -f html #{keyword}` end end |
#names ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/wri/ri_service.rb', line 21 def names @names ||= if library `ri -d #{library} --list-names` else `ri --list-names` end.split(/\s*\n/) end |