るりまサーチ

最速Rubyリファレンスマニュアル検索!
405件ヒット [1-100件を表示] (0.018秒)

別のキーワード

  1. point ==
  2. point eql?
  3. point group
  4. point invert!

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

OpenSSL::PKey::EC::Point.new(point) -> OpenSSL::PKey::EC::Point (21347.0)

Point オブジェクトを生成します。

...
Point
オブジェクトを生成します。

引数に OpenSSL::PKey::EC::Point オブジェクトを渡した場合は
それを複製します。

引数に OpenSSL::PKey::EC::Group オブジェクトを渡した場合は
それに関連付けられたオブジェクトを返します。

...
...る点を返します。

@param point 複製する OpenSSL::PKey::EC::Point オブジェクト
@param group 関連付ける群(OpenSSL::PKey::EC::Group オブジェクト)
@param bn 点を表す整数(OpenSSL::BN オブジェクト)
@raise OpenSSL::PKey::EC::Point::Error オブジェクトの生成...

OpenSSL::PKey::EC::Point.new(group) -> OpenSSL::PKey::EC::Point (21247.0)

Point オブジェクトを生成します。

...
Point
オブジェクトを生成します。

引数に OpenSSL::PKey::EC::Point オブジェクトを渡した場合は
それを複製します。

引数に OpenSSL::PKey::EC::Group オブジェクトを渡した場合は
それに関連付けられたオブジェクトを返します。

...
...る点を返します。

@param point 複製する OpenSSL::PKey::EC::Point オブジェクト
@param group 関連付ける群(OpenSSL::PKey::EC::Group オブジェクト)
@param bn 点を表す整数(OpenSSL::BN オブジェクト)
@raise OpenSSL::PKey::EC::Point::Error オブジェクトの生成...

OpenSSL::PKey::EC::Point.new(group, bn) -> OpenSSL::PKey::EC::Point (21247.0)

Point オブジェクトを生成します。

...
Point
オブジェクトを生成します。

引数に OpenSSL::PKey::EC::Point オブジェクトを渡した場合は
それを複製します。

引数に OpenSSL::PKey::EC::Group オブジェクトを渡した場合は
それに関連付けられたオブジェクトを返します。

...
...る点を返します。

@param point 複製する OpenSSL::PKey::EC::Point オブジェクト
@param group 関連付ける群(OpenSSL::PKey::EC::Group オブジェクト)
@param bn 点を表す整数(OpenSSL::BN オブジェクト)
@raise OpenSSL::PKey::EC::Point::Error オブジェクトの生成...

TracePoint.new(*events) {|obj| ... } -> TracePoint (21207.0)

新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。

...新しい TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。

//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.even...
...t]
end
# => #<TracePoint:0x007f17372cdb20>

trace.enable
# => false

puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}

トレースを無効にするには TracePoint#disable を実行してください。

//emlist[][ruby]{
trace.disable
//}

@param...
...ントに関連しない情報を取得するメソッドを実行した場合には
RuntimeError が発生します。

//emlist[例][ruby]{
TracePoint.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not supported by this event
//}

イベントフックの...

Fiddle::Pointer.new(addr, size = 0, free = nil) -> Fiddle::Pointer (21201.0)

与えられた addr が指すメモリ領域を表す Pointer オブジェクトを生成して返します。

... Pointer オブジェクトを生成して返します。

size を指定した場合、アドレス addr に確保されているメモリ領域のサイズは
size であると仮定されます。GC は free 関数を使用してメモリを解放します。

@param addr 生成する Pointer...
...オブジェクトが指すアドレスを整数で指定します。

@param size 生成する Pointer オブジェクトが指すメモリ領域のサイズを整数で指定します。

@param free GC 時に呼ばれる free 関数を Fiddle::Function オブジェクトか
整数で指定...

絞り込み条件を変える

StringScanner#pointer -> Integer (18106.0)

現在のスキャンポインタのインデックスを返します。

...現在のスキャンポインタのインデックスを返します。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.pos # => 0
s.scan(/\w+/) # => "test"
s.pos # => 4
s.scan(/\w+/) # => nil
s.pos # => 4
s.scan(/\s+/) # => " "
s.pos...

StringScanner#pointer=(n) (18106.0)

スキャンポインタのインデックスを n にセットします。

...長さを超える値を指定すると発生します。

@return n を返します。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"

begi...

Struct.new(*args, keyword_init: nil) -> Class (15561.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...では構造体のメンバに対するアクセスメソッドが定義されています。

//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}

実装の都合...
...][ruby]{
Point
1 = Struct.new(:x, :y)
Point
1.new(1, 2) # => #<struct Point1 x=1, y=2>
Point
1.new(x: 1, y: 2) # => #<struct Point1 x=1, y=2>
Point
1.new(x: 1) # => #<struct Point1 x=1, y=nil>
Point
1.new(y: 2) # => #<struct Point1 x=nil, y=2>
Point
1.new(x: 1, y:...
...)

Point
2 = Struct.new(:x, :y, keyword_init: nil)
Point
2.new(1, 2) # => #<struct Point2 x=1, y=2>
Point
2.new(x: 1, y: 2) # => #<struct Point2 x=1, y=2>
Point
2.new(x: 1) # => #<struct Point2 x=1, y=nil>
Point
2.new(y: 2) # => #<struct Point2 x=nil, y=2>
Point
2...

Struct.new(*args, keyword_init: nil) {|subclass| block } -> Class (15561.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...では構造体のメンバに対するアクセスメソッドが定義されています。

//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}

実装の都合...
...][ruby]{
Point
1 = Struct.new(:x, :y)
Point
1.new(1, 2) # => #<struct Point1 x=1, y=2>
Point
1.new(x: 1, y: 2) # => #<struct Point1 x=1, y=2>
Point
1.new(x: 1) # => #<struct Point1 x=1, y=nil>
Point
1.new(y: 2) # => #<struct Point1 x=nil, y=2>
Point
1.new(x: 1, y:...
...)

Point
2 = Struct.new(:x, :y, keyword_init: nil)
Point
2.new(1, 2) # => #<struct Point2 x=1, y=2>
Point
2.new(x: 1, y: 2) # => #<struct Point2 x=1, y=2>
Point
2.new(x: 1) # => #<struct Point2 x=1, y=nil>
Point
2.new(y: 2) # => #<struct Point2 x=nil, y=2>
Point
2...

Data.new(**kwargs) -> Data (15330.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...//emlist[例][ruby]{
Point
= Data.define(:x, :y)

p1 = Point.new(1, 2)
p p1.x # => 1
p p1.y # => 2

p2 = Point.new(x: 3, y: 4)
p p2.x # => 3
p p2.y # => 4
//}

new
に渡す引数の数がメンバの数より多い場合は new でエラーになります。

new
に渡す引数の...
...数がメンバの数より少ない場合は new ではエラーにならず、そのまま initialize に渡されます。
ユーザが initialize のオーバーライドを通して、少ない引数のときの適切な振舞いを実装可能とするためです。

次の例ではいずれ...
...ますが、
Point
.new に渡した位置引数の数が多い場合(上から2番目)のみ new でエラーが発生しており、
残りのケースではエラーの発生箇所は new ではなく initialize であることに注意してください。

//emlist[例][ruby]{
Point
= Data.defin...

絞り込み条件を変える

Data.new(*args) -> Data (15330.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...//emlist[例][ruby]{
Point
= Data.define(:x, :y)

p1 = Point.new(1, 2)
p p1.x # => 1
p p1.y # => 2

p2 = Point.new(x: 3, y: 4)
p p2.x # => 3
p p2.y # => 4
//}

new
に渡す引数の数がメンバの数より多い場合は new でエラーになります。

new
に渡す引数の...
...数がメンバの数より少ない場合は new ではエラーにならず、そのまま initialize に渡されます。
ユーザが initialize のオーバーライドを通して、少ない引数のときの適切な振舞いを実装可能とするためです。

次の例ではいずれ...
...ますが、
Point
.new に渡した位置引数の数が多い場合(上から2番目)のみ new でエラーが発生しており、
残りのケースではエラーの発生箇所は new ではなく initialize であることに注意してください。

//emlist[例][ruby]{
Point
= Data.defin...

Struct.new(*args, keyword_init: nil) -> Class (15321.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...では構造体のメンバに対するアクセスメソッドが定義されています。

//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}

実装の都合...
...

//emlist[例][ruby]{
Point
= Struct.new(:x, :y, keyword_init: true) # => Point(keyword_init: true)
Point
.new(x: 1, y: 2) # => #<struct Point x=1, y=2>
Point
.new(x: 1) # => #<struct Point x=1, y=nil>
Point
.new(y: 2) # => #<struct Point x=nil, y=2>
Point
.new(z: 3) # ArgumentErro...
...][ruby]{
Point
= Struct.new(:x, :y)
Point
.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

#...

Struct.new(*args, keyword_init: nil) {|subclass| block } -> Class (15321.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...では構造体のメンバに対するアクセスメソッドが定義されています。

//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}

実装の都合...
...

//emlist[例][ruby]{
Point
= Struct.new(:x, :y, keyword_init: true) # => Point(keyword_init: true)
Point
.new(x: 1, y: 2) # => #<struct Point x=1, y=2>
Point
.new(x: 1) # => #<struct Point x=1, y=nil>
Point
.new(y: 2) # => #<struct Point x=nil, y=2>
Point
.new(z: 3) # ArgumentErro...
...][ruby]{
Point
= Struct.new(:x, :y)
Point
.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

#...

Struct.new(*args) -> Class (15249.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...では構造体のメンバに対するアクセスメソッドが定義されています。

//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}

実装の都合...
...

//emlist[例][ruby]{
Point
= Struct.new(:x, :y, keyword_init: true) # => Point(keyword_init: true)
Point
.new(x: 1, y: 2) # => #<struct Point x=1, y=2>
Point
.new(x: 1) # => #<struct Point x=1, y=nil>
Point
.new(y: 2) # => #<struct Point x=nil, y=2>
Point
.new(z: 3) # ArgumentErro...
...ラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # => Struct::Foo
//}

=== 第一...
<< 1 2 3 ... > >>