⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
ENV
/
View File Name :
fetch-c.ri
U:RDoc::AnyMethod[iI" fetch:ETI"ENV::fetch;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"IIf +name+ is the name of an environment variable, returns its value:;To:RDoc::Markup::Verbatim; [I"ENV['foo'] = '0' ;TI"ENV.fetch('foo') # => '0' ;T:@format0o; ; [I">Otherwise if a block is given (but not a default value), ;TI"Eyields +name+ to the block and returns the block's return value:;To;; [I"ZENV.fetch('foo') { |name| :need_not_return_a_string } # => :need_not_return_a_string ;T;0o; ; [I"XOtherwise if a default value is given (but not a block), returns the default value:;To;; [I"ENV.delete('foo') ;TI"XENV.fetch('foo', :default_need_not_be_a_string) # => :default_need_not_be_a_string ;T;0o; ; [I"VIf the environment variable does not exist and both default and block are given, ;TI"Lissues a warning ("warning: block supersedes default value argument"), ;TI"Fyields +name+ to the block, and returns the block's return value:;To;; [I"LENV.fetch('foo', :default) { |name| :block_return } # => :block_return ;T;0o; ; [I"8Raises KeyError if +name+ is valid, but not found, ;TI"2and neither default value nor block is given:;To;; [I"?ENV.fetch('foo') # Raises KeyError (key not found: "foo") ;T;0o; ; [I"/Raises an exception if +name+ is invalid. ;TI"OSee {Invalid Names and Values}[#class-ENV-label-Invalid-Names+and+Values].;T: @fileI"hash.c;T:0@omit_headings_from_table_of_contents_below0I"~ENV.fetch(name) -> value ENV.fetch(name, default) -> value ENV.fetch(name) { |name| block } -> value ;T0[ I"(*args);T@3FI"ENV;TcRDoc::NormalClass00