るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

Thread::Backtrace::Location#to_s -> String (21126.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。

//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.to_s
end
...
...# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...

Rake::FileList#to_s -> String (21114.0)

全ての要素をスペースで連結した文字列を返します。

...全ての要素をスペースで連結した文字列を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.to_s # => "a.c b.c"
end

//}...

WIN32OLE_VARIABLE#to_s -> String (21108.0)

変数名を取得します。

...変数名を取得します。

@return 変数名を文字列で返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end
...

Module#to_s -> String (18132.0)

モジュールやクラスの名前を文字列で返します。

...は nil を、それ以外はオブジェクト ID の文字列を返します。

//emlist[例][ruby]{
module A
module B
end


p B.name #=> "A::B"

class C
end

end


p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"

# 名前のないモジュール / クラス
p Module.new...
....name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b09112c8>"
p Class.new.to_s #=> "#<Class:0x00007fa5c40b41b0>"
//}...

OptionParser#to_s -> String (18114.0)

サマリの文字列を返します。

...します。

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

options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"

opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end

end


puts opts.help

# => Usage: example.rb [options]
# -v...
..., --[no-]verbose Run verbosely
//}...

絞り込み条件を変える

Symbol#end_with?(*suffixes) -> bool (9238.0)

self の末尾が suffixes のいずれかであるとき true を返します。

...self の末尾が suffixes のいずれかであるとき true を返します。

(self.to_s.end_with?と同じです。)

@param suffixes パターンを表す文字列 (のリスト)

@see Symbol#start_with?

@see String#end_with?

//emlist[][ruby]{
:hello.end_with?("ello") #=> tru...
...e

# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}...

WIN32OLE_EVENT#handler=(obj) -> () (9143.0)

イベント処理を実行するオブジェクトを登録します。

...ilを指定します。

class IeHandler
def initialize
@completed = false
end

attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end

@completed = true
end
...
...=#{id.to_s}, args=#{args.inspect}"
end

end


ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
l
oop do
break if event.handler.completed
WIN32OLE_EVE...
...NT.message_loop
end

ie.Quit

WIN32OLE_EVENT#on_eventなどの呼び出しでブロックが登録されている場
合、そちらが優先されます。...

Pathname#opendir {|dir| ... } -> nil (6217.0)

Dir.open(self.to_s, &block) と同じです。

...Dir.open(self.to_s, &block) と同じです。


@see Dir.open...

Object#define_singleton_method(symbol) { ... } -> Symbol (6131.0)

self に特異メソッド name を定義します。

...self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Sy...
...mbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s

end

end

end

A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end

A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello...
...#=> "Bob: Hello there!"
//}...

Object#define_singleton_method(symbol, method) -> Symbol (6131.0)

self に特異メソッド name を定義します。

...self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Sy...
...mbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s

end

end

end

A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end

A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello...
...#=> "Bob: Hello there!"
//}...

絞り込み条件を変える

<< 1 2 3 > >>