るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

Integer#<(other) -> bool (21112.0)

比較演算子。数値として小さいか判定します。

...比較演算子。数値として小さいか判定します。

@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}...

Shell::Filter#<(src) -> self (21106.0)

srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ ばそれをそのまま入力とする。

..., IOオブジェクトであれ
ばそれをそのまま入力とする。

@param src フィルタの入力を, 文字列もしくは,IO オブジェクトで指定します。

使用例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
(sh.head("-n 30") < "...

BigDecimal#<(other) -> bool (21100.0)

self が other より小さい場合に true を、そうでない場合に false を返しま す。

self が other より小さい場合に true を、そうでない場合に false を返しま
す。

Fixnum#<(other) -> bool (21100.0)

比較演算子。数値として小さいか判定します。

比較演算子。数値として小さいか判定します。

@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。

Module#<(other) -> bool | nil (18236.0)

比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。

...較では
nil を返します。

@param other 比較対象のモジュールやクラス

@raise TypeError other がクラスやモジュールではない場合に発生します。

//emlist[例][ruby]{
module Foo
end
class Bar
i
nclude 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)
//}...

絞り込み条件を変える

VALUE rb_time_timespec_new(const struct timespec *ts, int offset) (12312.0)

引数 ts、offset を元に Time オブジェクトを作成して返します。

...元に Time オブジェクトを作成して返します。

@param ts timespec 構造体のポインタ

@param offset 協定世界時との時差(秒)。
-86400 < offset < 86400 の場合は指定した時差に、INT_MAX
を指定した場合は地方時、INT_MAX-1...
...を指定した場合は UTC に
なります。

@raise ArgumentError offset に上述の範囲以外の値を指定した場合に発生し
ます。...

WEBrick::BasicLog#<<(obj) -> () (12100.0)

指定された obj を to_s メソッドで文字列に変換してから、 ログレベル INFO でログに記録します。

...に変換してから、
ログレベル INFO でログに記録します。

@param obj 記録したいオブジェクトを指定します。文字列でない場合は to_s メソッドで文字列に変換します。

require 'webrick'
logger = WEBrick::BasicLog.new()
logger << 'hoge'...

rinda/rinda (12012.0)

Rubyで実装されたタプルスペース(Tuple Space)を扱うためのライブラリです。

...対しては、タプルを書き込む(write)、取り出す(take)、
タプルの要素を覗き見る(read)
という操作のみが利用できます。可能な操作を限定し、定型化することで
安全な同期処理を実現します。rinda においてはタプルとは
配列も...
...ースそのものの実装は rinda/tuplespace でなされています。
このライブラリはタプルスペースへのアクセス機能等を提供します。

=== 参考
* http://www.druby.org/ilikeruby/rinda.html
* http://www2a.biglobe.ne.jp/~seki/ruby/d208.html

===[a:tuplepattern]...
...uire 'rinda/tuplespace'

uri = ARGV.shift
DRb.start_service(uri, Rinda::TupleSpace.new)
puts DRb.uri
DRb.thread.join


# rindas.rb
require 'drb/drb'
require 'rinda/rinda'

def do_it(v)
puts "do_it(#{v})"
v + v
end

uri = ARGV.shift || raise("usage: #{$0} <server_uri...

RubyVM::InstructionSequence.compile_file(file, options = nil) -> RubyVM::InstructionSequence (9406.0)

引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。

RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。

@param file...
...tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

# /tmp/hello.rb
puts "Hello, world!"

# i...
...rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>

@see RubyVM::InstructionSequence.compile...

REXML::Attributes#each_attribute {|attribute| ... } -> () (9212.0)

各属性に対しブロックを呼び出します。

...ttribute オブジェクトで渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<
root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<
a foo:att='1' bar:att='2' att='&lt;'/>
<
/root>
EOS
a = doc.get_elements("/root/a").firs...
...t

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

絞り込み条件を変える

REXML::Attributes#get_attribute(name) -> Attribute | nil (9212.0)

name という名前の属性を取得します。

...は nil を返します。

@param name 属性名(文字列)
@see REXML::Attributes#[]

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<
root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<
a foo:att='1' bar:att='2' att='&lt;'/>
<
/root>...
...EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...
<< 1 2 3 ... > >>