るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 ... > >>

Class#json_creatable? -> bool (9007.0)

シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は 真を返します。そうでない場合は、偽を返します。

...json_create というメソッドを実装していなければなりません。
また json_create の第一引数は必要なデータを含むハッシュを期待しています。

//emlist[例][ruby]{
require
"json"

String.json_creatable? # => true
Dir.json_creatable? # => false
//}...

ERB#def_class(superklass=Object, methodname=&#39;erb&#39;) -> Class (6221.0)

変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。

...t[例][ruby]{
require
'erb'

class
MyClass_
def initialize(arg1, arg2)
@arg1 = arg1; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtml

erb = ERB.new(File.read(filename))
erb.filename = filename
MyClass = erb.def_class(MyClass_, 'render()...

Kernel#DelegateClass(superclass) -> object (6219.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。

...クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。

@param superclass 委譲先となるクラス

例:

//emlist{
require
'delegate'

class
ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = E...
...xtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}...

Set#classify {|o| ... } -> Hash (6113.0)

集合をブロックの値によって分類し、結果をハッシュとして返します。

...ます。

生成されるハッシュのキーはブロックの実行結果、値は分類された集合と
なります。

//emlist[][ruby]{
require
'set'
numbers = Set[10, 4.5, 20, 30, 31.2]
p numbers.classify {|o| o.class}
# => {Integer=>#<Set: {10, 20, 30}>, Float=>#<Set: {4.5, 31.2}>}
//}...

NilClass#to_d -> BigDecimal (3013.0)

BigDecimal オブジェクトの 0.0 を返します。

...BigDecimal オブジェクトの 0.0 を返します。

Ruby 2.6 で追加されたメソッドです。

//emlist[][ruby]{
require
"bigdecimal"
require
"bigdecimal/util"

p nil.to_d # => 0.0
//}...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::FalseClass#to_json(state_or_hash = nil) -> String (3007.0)

自身から生成した JSON 形式の文字列を返します。

...JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require
"json"

false.to_json # => "false"
//}...

JSON::Generator::GeneratorMethods::NilClass#to_json(state_or_hash = nil) -> String (3007.0)

自身から生成した JSON 形式の文字列を返します。

...る JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require
"json"

nil.to_json # => "null"
//}...

JSON::Generator::GeneratorMethods::TrueClass#to_json(state_or_hash = nil) -> String (3007.0)

自身から生成した JSON 形式の文字列を返します。

...る JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require
"json"

true.to_json # => "true"
//}...

Fiddle::Importer#struct(signature) -> Class (108.0)

C の構造体型に対応する Ruby のクラスを構築して返します。

...ます。詳しくは
そちらを参照してください。


@param signature 構造体の各要素を文字列で表現したものの配列

require
'fiddle/import'

module M
extend Fiddle::Importer
dlload "libc.so.6"
extern "int gettimeofday(void*, void*)"
Timeval = struc...
<< 1 2 3 ... > >>