203件ヒット
[1-100件を表示]
(0.148秒)
ライブラリ
- ビルトイン (98)
-
fiddle
/ import (11) - json (11)
- optparse (22)
- pathname (11)
- rake (11)
-
shell
/ filter (6) - win32ole (33)
クラス
- Module (33)
- Object (22)
- OptionParser (22)
- Pathname (11)
-
Rake
:: FileList (11) -
Shell
:: Filter (6) - Symbol (10)
- Thread (11)
-
Thread
:: Backtrace :: Location (22) -
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ VARIABLE (22)
モジュール
キーワード
- bind (11)
-
define
_ singleton _ method (22) -
end
_ with? (5) - handler= (11)
- help (11)
- inspect (22)
- name (22)
- opendir (11)
-
set
_ trace _ func (11) -
start
_ with? (5) -
to
_ json (11) - | (6)
検索結果
先頭5件
-
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/'
loop 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!"
//}...