332件ヒット
[1-100件を表示]
(0.039秒)
種類
- インスタンスメソッド (243)
- 特異メソッド (84)
- 文書 (5)
ライブラリ
- ビルトイン (158)
-
minitest
/ unit (1) -
rdoc
/ text (12) -
rdoc
/ top _ level (12) - resolv (12)
-
webrick
/ httpserver (24) -
webrick
/ httpservlet / abstract (108)
クラス
- Complex (36)
- File (18)
- Object (36)
-
RDoc
:: TopLevel (12) -
Resolv
:: DNS :: Name (12) -
RubyVM
:: AbstractSyntaxTree :: Node (14) -
RubyVM
:: InstructionSequence (12) -
Thread
:: Backtrace :: Location (12) -
WEBrick
:: HTTPServer :: MountTable (24) -
WEBrick
:: HTTPServlet :: AbstractServlet (108)
モジュール
-
MiniTest
:: Assertions (1) -
RDoc
:: Text (12) -
RubyVM
:: AbstractSyntaxTree (30)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) - [] (12)
- abs2 (12)
-
absolute
_ path (36) -
absolute
_ path? (6) -
assert
_ in _ epsilon (1) - children (7)
- delete (12)
-
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) -
file
_ absolute _ name= (12) -
get
_ instance (12) - inspect (7)
- magnitude (12)
- method (12)
- new (24)
- of (10)
- parse (10)
-
parse
_ file (10) - send (24)
- service (12)
検索結果
先頭5件
-
Complex
# abs -> Numeric (18131.0) -
自身の絶対値を返します。
...す。
以下の計算の結果を Float オブジェクトで返します。
sqrt(self.real ** 2 + self.imag ** 2)
//emlist[例][ruby]{
Complex(1, 2).abs # => 2.23606797749979
Complex(3, 4).abs # => 5.0
Complex('1/2', '1/2').abs # => 0.7071067811865476
//}
@see Complex#abs2... -
Complex
# abs2 -> Numeric (6131.0) -
自身の絶対値の 2 乗を返します。
...自身の絶対値の 2 乗を返します。
以下の計算の結果を返します。
self.real ** 2 + self.imag ** 2
//emlist[例][ruby]{
Complex(1, 1).abs2 # => 2
Complex(1.0, 1.0).abs2 # => 2.0
Complex('1/2', '1/2').abs2 # => (1/2)
//}
@see Complex#abs... -
File
. absolute _ path?(file _ name) -> bool (6112.0) -
file_name が絶対パスなら true を、そうでなければ false を返します。
...、そうでなければ false を返します。
@param file_name ファイル名を表す文字列を指定します。文字列でない場合は、to_path メソッド、to_str メソッドの順で暗黙の型変換が試みられます。
@raise TypeError 引数に文字列以外の(暗黙......st[例][ruby]{
File.absolute_path?("//foo/bar\\baz") # => true
File.absolute_path?("C:foo\\bar") # => false
File.absolute_path?("~") # => false
# プラットフォームが cygwin、mswin、mingw の場合
File.absolute_path?("C:\\foo\\bar") # => true
File.absolute_path?("/foo/b......ar\\baz") # => false
# プラットフォームが上記以外の場合
File.absolute_path?("C:\\foo\\bar") # => false
File.absolute_path?("/foo/bar\\baz") # => true
//}... -
Thread
:: Backtrace :: Location # absolute _ path -> String (6112.0) -
self が表すフレームの絶対パスを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
File
. absolute _ path(file _ name , dir _ string=nil) -> String (6106.0) -
file_name を絶対パスに変換した文字列を返します。
...ME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}
@see File.expand_path......OME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}
@see File.expand_path... -
RDoc
:: Text # expand _ tabs(text) -> String (6106.0) -
引数中のタブ(\t)を直前の連続するスペースと合計して 8 文字のスペースにな るように置き換えます。
...引数中のタブ(\t)を直前の連続するスペースと合計して 8 文字のスペースにな
るように置き換えます。
@param text 文字列を指定します。... -
RDoc
:: TopLevel # file _ absolute _ name=(val) (6106.0) -
自身が管理するファイルに関する絶対パスを文字列で設定します。
...自身が管理するファイルに関する絶対パスを文字列で設定します。
@param val パスを文字列で指定します。... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (6106.0) -
self が表す命令シーケンスの絶対パスを返します。
...uence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # =>......"/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (3208.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ドを返します。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true......定すると、 Node#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとし......す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (3208.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ドを返します。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true......定すると、 Node#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとし......す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (3184.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...では動作しません。
@param proc Procもしくはメソッドオブジェクトを指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を......きます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
#......gs: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
#... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (3184.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...では動作しません。
@param proc Procもしくはメソッドオブジェクトを指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を......きます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
#......gs: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
#...