650件ヒット
[1-100件を表示]
(0.147秒)
ライブラリ
- ビルトイン (161)
-
irb
/ cmd / help (11) - json (66)
- psych (28)
- rake (33)
- resolv (33)
-
rexml
/ document (187) -
rubygems
/ commands / update _ command (11) -
rubygems
/ specification (22) - socket (22)
-
webrick
/ config (11)
クラス
- Data (2)
- Encoding (11)
-
Gem
:: Commands :: UpdateCommand (11) -
Gem
:: Specification (22) -
IRB
:: ExtendCommand :: Help (11) - MatchData (11)
- Module (61)
-
REXML
:: Attribute (11) -
REXML
:: Attributes (22) -
REXML
:: DocType (11) -
REXML
:: Element (44) -
REXML
:: XPath (33) -
Rake
:: FileList (11) - Regexp (11)
- Resolv (22)
-
Resolv
:: Hosts (11) - RubyVM (11)
- Socket (11)
モジュール
- JSON (55)
- Kernel (22)
- ObjectSpace (22)
- Psych (28)
-
REXML
:: Namespace (66) -
Rake
:: TaskManager (11) -
Socket
:: Constants (11) -
WEBrick
:: Config (11)
オブジェクト
- main (32)
キーワード
- DigestAuth (11)
-
IF
_ NAMESIZE (22) -
INSTRUCTION
_ NAMES (11) - JSON (11)
-
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - [] (11)
-
add
_ namespace (11) - attribute (11)
-
attribute
_ names (11) - cgi (11)
-
deconstruct
_ keys (2) - each (11)
-
each
_ object (22) - execute (11)
- first (11)
-
get
_ attribute _ ns (11) - getnames (33)
-
has
_ name? (11) -
in
_ namespace (11) - include (11)
- irb (11)
- load (22)
-
local
_ name (11) - match (11)
- name (11)
- namespace (33)
- namespaces (33)
- parse (11)
- parse! (11)
- prefix (11)
- private (32)
-
private
_ class _ method (8) - protected (8)
- public (32)
-
public
_ class _ method (8) - rdoc (11)
-
read
_ only (11) - restore (11)
-
ruby2
_ keywords (5) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / search _ command (11) -
safe
_ load (17) -
test
/ unit (1) -
which
_ to _ update (11)
検索結果
先頭5件
-
irb (26330.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......す。
readline ライブラリがインストールされている時には
自動的にコマンドライン編集や履歴の機能が使えるようになります。
=== irb のコマンドラインオプション
irb [options] file_name opts
options:
-f ~/.irbrc を読......、irb 上で一行ず
つ評価されます。require に成功した場合は true を、そうでない場合は
false を返します。
拡張ライブラリ(*.so,*.o,*.dll など)を指定した場合は単純に require さ
れます。
: help(*names)
: irb_help(*names)
RI から... -
Encoding
# names -> String (21313.0) -
エンコーディングの名前とエイリアス名の配列を返します。
...エンコーディングの名前とエイリアス名の配列を返します。
//emlist[例][ruby]{
Encoding::UTF_8.names #=> ["UTF-8", "CP65001"]
//}... -
MatchData
# names -> [String] (18319.0) -
名前付きキャプチャの名前を文字列配列で返します。
...前を文字列配列で返します。
self.regexp.names と同じです。
//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").names
# => ["foo", "bar", "baz"]
m = /(?<x>.)(?<y>.)?/.match("a") # => #<MatchData "a" x:"a" y:nil>
m.names # => ["x", "y"]
//}... -
Regexp
# names -> [String] (18319.0) -
正規表現に含まれる名前付きキャプチャ(named capture)の名前を 文字列の配列で返します。
...正規表現に含まれる名前付きキャプチャ(named capture)の名前を
文字列の配列で返します。
//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)(?<baz>.)/.names
# => ["foo", "bar", "baz"]
/(?<foo>.)(?<foo>.)/.names
# => ["foo"]
/(.)(.)/.names
# => []
//}... -
RubyVM
:: INSTRUCTION _ NAMES -> [String] (12401.0) -
RubyVM の命令シーケンスの名前の一覧を返します。
...RubyVM の命令シーケンスの名前の一覧を返します。
@see RubyVM::InstructionSequence... -
Gem
:: Specification . attribute _ names -> Array (12301.0) -
属性名の配列を返します。
属性名の配列を返します。 -
Rake
:: TaskManager # in _ namespace(name) {|name _ space| . . . } -> Array (12300.0) -
与えられた名前の名前空間でブロックを評価します。
...ます。
@param name 名前を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
namespace :sample do
def hoge
puts "hoge"
end
end
task :test_rake_app do
task.application.in_namespace("sample") do
hoge # => "hoge"
end
end
//}... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (9400.0) -
属性の名前空間の URI を返します。
...の URI を返します。
URI が定義されていない場合は nil を返します。
@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。
//emlist[][ruby]{
require 'r......exml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9400.0) -
namespace と name で特定される属性を返します。
...namespace と name で特定される属性を返します。
namespace で名前空間を、 name で prefix を含まない属性名を
指定します。
指定された属性が存在しない場合は nil を返します。
XML プロセッサが prefix を置き換えてしまった場合......使うことで属性を正しく指定することができます。
@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://exampl......ot/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}... -
REXML
:: Attributes # namespaces -> { String => String } (9400.0) -
self の中で宣言されている名前空間の集合を返します。
...lf の中で宣言されている名前空間の集合を返します。
返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmln......s:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...