804件ヒット
[1-100件を表示]
(0.145秒)
別のキーワード
クラス
-
ARGF
. class (24) - BasicObject (72)
- Class (12)
- Hash (50)
- Integer (12)
- Method (82)
- Module (168)
- Object (120)
- OptionParser (144)
-
RubyVM
:: InstructionSequence (12) -
Thread
:: Backtrace :: Location (36) - UnboundMethod (12)
-
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (48)
キーワード
- ! (12)
- != (12)
- < (12)
- << (7)
- == (12)
- === (8)
- >> (7)
- [] (12)
-
_ dump (12) -
absolute
_ path (12) -
base
_ label (12) - bind (12)
- call (24)
-
class
_ eval (24) -
class
_ exec (12) -
default
_ event _ sources (12) -
define
_ singleton _ method (24) - display (12)
-
each
_ entry (24) - extend (12)
- getbyte (12)
- getc (12)
- inherited (12)
-
initialize
_ copy (12) - inspect (6)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
marshal
_ load (12) - merge (24)
-
module
_ eval (24) -
module
_ exec (12) - on (144)
-
prepend
_ features (12) -
pretty
_ print (12) -
public
_ class _ method (24) -
public
_ constant (12) - replace (12)
-
singleton
_ class? (12) -
singleton
_ methods (12) -
sort
_ by (24) -
to
_ a (12) -
to
_ bn (12) -
to
_ h (14) -
to
_ s (18) - unbind (12)
-
undef
_ method (12)
検索結果
先頭5件
-
Object
# class -> Class (24275.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Module
# public _ class _ method(*name) -> self (18441.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...ublic に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMeth......odError: private method `foo' called for Foo:Class
Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# public _ class _ method(names) -> self (18441.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...ublic に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMeth......odError: private method `foo' called for Foo:Class
Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Class
# inherited(subclass) -> () (15349.0) -
クラスのサブクラスが定義された時、新しく生成されたサブクラスを引数 にインタプリタから呼び出されます。このメソッドが呼ばれるタイミングは クラス定義文の実行直前です。
...ubclass プログラム内で新たに定義された自身のサブクラスです。
//emlist[例][ruby]{
class Foo
def Foo.inherited(subclass)
puts "class \"#{self}\" was inherited by \"#{subclass}\""
end
end
class Bar < Foo
puts "executing class body"
end
# => class "Foo" was inherit......ed by "Bar"
# executing class body
//}... -
ARGF
. class # getbyte -> Integer | nil (15235.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
...
self から 1 バイト(0..255)を読み込み整数として返します。
既に EOF に達していれば nil を返します。
ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想フ......cho "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getbyte # => 102
ARGF.getbyte # => 111
ARGF.getbyte # => 111
ARGF.getbyte # => 10
ARGF.getbyte # => 98
ARGF.getbyte # => 97
ARGF.getbyte # => 114
ARGF.getbyte # => 10
ARGF.getbyte # => nil
@see ARGF.class#getc, ARGF.class#gets... -
Thread
:: Backtrace :: Location # absolute _ path -> String (15229.0) -
self が表すフレームの絶対パスを返します。
...
self が表すフレームの絶対パスを返します。
//emlist[例][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... -
Module
# singleton _ class? -> bool (12348.0) -
self が特異クラスの場合に true を返します。そうでなければ false を返し ます。
...
self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。
//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}... -
Integer
# to _ bn -> OpenSSL :: BN (12325.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
...nteger を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'pp'
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class......Integer
def to_bn
OpenSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i......Integer を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
d......ef to_bn
OpenSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i... -
Module
# public _ constant(*name) -> self (12320.0) -
name で指定した定数の可視性を public に変更します。
...視性を public に変更します。
@param name 0 個以上の String か Symbol を指定します。
@raise NameError 存在しない定数を指定した場合に発生します。
@return self を返します。
//emlist[例][ruby]{
module SampleModule
class SampleInnerClass
end
#......private にする
private_constant :SampleInnerClass
end
begin
SampleModule::SampleInnerClass
rescue => e
e # => #<NameError: private constant SampleModule::SampleInnerClass referenced>
end
module SampleModule
# => 非公開クラスであることは承知で利用するために public......にする
public_constant :SampleInnerClass
end
SampleModule::SampleInnerClass # => SampleModule::SampleInnerClass
//}
@see Module#private_constant, Object#untrusted?......にする
public_constant :SampleInnerClass
end
SampleModule::SampleInnerClass # => SampleModule::SampleInnerClass
//}
@see Module#private_constant...