Class: RIO::Temp::File::RL
- Inherits:
-
RL::PathBase
- Object
- RL::Base
- RL::WithPath
- RL::URIBase
- RL::PathBase
- RIO::Temp::File::RL
- Defined in:
- lib/rio/scheme/temp.rb
Constant Summary collapse
- RIOSCHEME =
'tempfile'
- DFLT_PREFIX =
Temp::RL::DFLT_PREFIX
- DFLT_TMPDIR =
Temp::RL::DFLT_TMPDIR
- SPLIT_RE =
Temp::RL::SPLIT_RE
Constants inherited from RL::PathBase
Constants inherited from RL::URIBase
RL::URIBase::HOST, RL::URIBase::SCHEME
Constants inherited from RL::WithPath
RL::WithPath::HOST, RL::WithPath::SCHEME
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#tmpdir ⇒ Object
readonly
Returns the value of attribute tmpdir.
-
#tmprl ⇒ Object
readonly
Returns the value of attribute tmprl.
Attributes inherited from RL::URIBase
Attributes inherited from RL::Base
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
- #file_rl ⇒ Object
-
#initialize(file_prefix = DFLT_PREFIX, temp_dir = DFLT_TMPDIR) ⇒ RL
constructor
A new instance of RL.
-
#open(mode = 'ignored') ⇒ Object
self.
Methods inherited from RL::PathBase
#arg0_info_, #build_arg0_, #fspath, #join, #scheme, #to_s, #url, #use_host?
Methods inherited from RL::URIBase
#_get_base_from_arg, #_get_opts_from_args, #absolute?, #arg0_info_, #base, #base=, #host, #host=, #init_from_args_, #initialize_copy, #join, #opaque, #openfs_, #path, #path=, #pathroot, #scheme, #to_s, #url, #urlpath, #urlpath=, #urlroot
Methods inherited from RL::WithPath
#_build, #_parts, #_uri, #abs, #base, #basename, #build_arg0_, #dirname, #filename, #fspath, #fspath=, #fspath_no_slash, #host, #host=, #is_root?, #join, #merge, #opaque, #openfs_, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #route_from, #route_to, #scheme, #split, #uri, #uri_from_string_, #urlpath, #urlpath=
Methods included from Error::NotImplemented
Methods inherited from RL::Base
#==, #===, #=~, #callstr, #escape, #fs2url, #fspath, #initialize_copy, is_riorl?, #length, #openfs_, parse, #path, #rl, split_riorl, subscheme, #to_rl, #to_s, #unescape, #url, #url2fs
Constructor Details
#initialize(file_prefix = DFLT_PREFIX, temp_dir = DFLT_TMPDIR) ⇒ RL
Returns a new instance of RL.
112 113 114 115 116 117 118 119 |
# File 'lib/rio/scheme/temp.rb', line 112 def initialize(file_prefix=DFLT_PREFIX,temp_dir=DFLT_TMPDIR) #puts "initialize(#{file_prefix.inspect},#{temp_dir.inspect})" @prefix = file_prefix || DFLT_PREFIX @tmpdir = temp_dir || DFLT_TMPDIR require 'tempfile' @tf = ::Tempfile.new( @prefix.to_s, @tmpdir.to_s) super(@tf.path) end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
111 112 113 |
# File 'lib/rio/scheme/temp.rb', line 111 def prefix @prefix end |
#tmpdir ⇒ Object (readonly)
Returns the value of attribute tmpdir.
111 112 113 |
# File 'lib/rio/scheme/temp.rb', line 111 def tmpdir @tmpdir end |
#tmprl ⇒ Object (readonly)
Returns the value of attribute tmprl.
111 112 113 |
# File 'lib/rio/scheme/temp.rb', line 111 def tmprl @tmprl end |
Class Method Details
Instance Method Details
#close ⇒ Object
128 129 130 131 |
# File 'lib/rio/scheme/temp.rb', line 128 def close super @tf = nil end |
#file_rl ⇒ Object
120 121 122 123 |
# File 'lib/rio/scheme/temp.rb', line 120 def file_rl() RIO::File::RL.new(self.uri,{:fs => self.fs}) #self end |
#open(mode = 'ignored') ⇒ Object
self
124 125 126 127 |
# File 'lib/rio/scheme/temp.rb', line 124 def open(mode='ignored') #p callstr('open',mode) @tf end |