934件ヒット
[1-100件を表示]
(0.062秒)
別のキーワード
ライブラリ
- ビルトイン (766)
- csv (72)
- rake (72)
-
rake
/ loaders / makefile (12) -
rexml
/ streamlistener (12)
クラス
- Array (45)
- BasicObject (60)
- CSV (72)
- Class (20)
- Exception (24)
- Hash (14)
- Method (42)
- Module (168)
- Object (120)
- Proc (55)
-
Rake
:: MakefileLoader (12) -
Rake
:: NameSpace (12) - Range (19)
-
RubyVM
:: InstructionSequence (48) - String (12)
-
Thread
:: Backtrace :: Location (12) - TracePoint (7)
- UnboundMethod (12)
モジュール
- Enumerable (108)
-
REXML
:: StreamListener (12) -
Rake
:: TaskManager (60)
キーワード
- ! (12)
- != (12)
- << (26)
- <= (12)
- <=> (12)
- == (12)
- === (24)
- [] (36)
-
absolute
_ path (12) -
add
_ row (12) - ancestors (12)
-
backtrace
_ locations (12) -
base
_ label (24) - bind (12)
- call (12)
-
class
_ variables (12) -
const
_ source _ location (12) - convert (36)
- cover? (19)
-
define
_ task (12) - entitydecl (12)
-
enum
_ for (24) - include (12)
- include? (12)
- inherited (12)
- initialize (12)
- inspect (12)
-
instance
_ eval (24) -
instance
_ methods (12) -
instance
_ of? (12) -
instruction
_ sequence (7) - intern (12)
-
is
_ a? (12) -
kind
_ of? (12) - label (12)
- lazy (12)
- load (12)
- lookup (12)
- max (48)
-
method
_ defined? (12) - methods (12)
- min (48)
- pack (21)
- path (12)
-
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) - puts (12)
-
set
_ backtrace (12) - subclasses (4)
-
super
_ method (11) - superclass (4)
-
synthesize
_ file _ task (12) -
to
_ a (12) -
to
_ ary (12) -
to
_ enum (24) -
to
_ h (14) -
to
_ s (12) -
undef
_ method (12) - unpack (12)
- yield (12)
検索結果
先頭5件
-
Module
# <(other) -> bool | nil (18179.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...す。
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar #......=> true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil
p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}... -
Method
# <<(callable) -> Proc (6161.0) -
self と引数を合成した Proc を返します。
...呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3) # => 36
//}
//emlist[cal......例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Pro... -
Module
# <=(other) -> bool | nil (6143.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo <=......Bar # => false
Bar <= Foo # => true
Baz.ancestors # => [Foo, Baz]
Foo <= Baz # => false
Baz <= Foo # => true
Foo <= Foo # => true
Foo <= Object # => nil
//}... -
Module
# <=>(other) -> Integer | nil (6143.0) -
self と other の継承関係を比較します。
...
@param other 比較対象のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=>... -
Proc
# <<(callable) -> Proc (6143.0) -
self と引数を合成した Proc を返します。
...。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }
# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}
//emlist[call を定義したオブジェクトを渡す例][ruby]{
c......anner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}
@see Method#<<, Method#>>... -
CSV
# <<(row) -> self (6131.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
CSV
# add _ row(row) -> self (3031.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
CSV
# puts(row) -> self (3031.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
RubyVM
:: InstructionSequence # base _ label -> String (3025.0) -
self が表す命令シーケンスの基本ラベルを返します。
...iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb......> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
RubyVM
:: InstructionSequence # label -> String (3025.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...では "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled......>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello,......world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_label...