2439件ヒット
[2401-2439件を表示]
(0.025秒)
ライブラリ
- ビルトイン (1894)
- erb (12)
-
fiddle
/ import (84) -
irb
/ context (12) -
minitest
/ spec (1) -
minitest
/ unit (1) -
mutex
_ m (24) - objspace (12)
- profiler (6)
- psych (8)
- rake (12)
-
rdoc
/ code _ object (12) -
rdoc
/ context (84) -
rdoc
/ stats (12) -
rdoc
/ top _ level (48) - win32ole (36)
クラス
- BasicObject (72)
- Class (24)
- ERB (12)
-
Enumerator
:: Lazy (60) - Hash (6)
-
IRB
:: Context (12) - Method (36)
- Module (1164)
- Object (240)
- Proc (18)
-
RDoc
:: CodeObject (12) -
RDoc
:: Context (84) -
RDoc
:: Stats (12) -
RDoc
:: TopLevel (48) - Refinement (4)
- SystemCallError (12)
- TracePoint (12)
- UnboundMethod (24)
- WIN32OLE (12)
-
WIN32OLE
_ TYPE (24)
モジュール
- Enumerable (48)
-
Fiddle
:: Importer (84) - Kernel (60)
- Marshal (24)
-
MiniTest
:: Assertions (1) -
Mutex
_ m (24) - ObjectSpace (12)
- Warning (9)
オブジェクト
- main (102)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- <= (12)
- <=> (12)
- === (36)
- >= (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
Profiler
_ _ (6) - Ruby プログラムの実行 (12)
-
add
_ class _ or _ module (24) -
add
_ module (12) -
alias
_ method (12) -
all
_ classes _ and _ modules (12) - ancestors (12)
-
append
_ features (24) -
assert
_ instance _ of (1) - attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - autoload (24)
- autoload? (12)
- bind (24)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) -
const
_ added (3) -
const
_ defined? (12) -
const
_ get (12) -
const
_ load (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (24)
-
count
_ objects _ size (12) -
create
_ value (12) - debug (12)
-
def
_ module (12) -
default
_ event _ sources (12) -
define
_ method (48) -
defined
_ class (12) -
deprecate
_ constant (12) - dump (24)
-
each
_ classmodule (12) -
enum
_ for (48) - eval (24)
- extend (12)
-
extend
_ object (24) - extended (12)
- extern (12)
-
find
_ enclosing _ module _ named (12) -
find
_ local _ symbol (12) -
find
_ module _ named (24) - freeze (12)
-
global
_ variables (12) -
import
_ methods (4) - include (24)
- include? (12)
- included (12)
-
included
_ modules (12) -
infect
_ with _ assertions (1) -
initialize
_ classes _ and _ modules (12) - inspect (24)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ variables (12) -
is
_ a? (12) -
kind
_ of? (12) - lambda? (12)
-
load
_ modules (12) -
local
_ variables (12) -
max
_ by (48) - method (12)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
-
module
_ eval (24) -
module
_ exec (12) -
module
_ function (36) - modules (12)
- name (12)
- nesting (12)
- new (60)
-
num
_ modules (12) -
ole
_ type (12) - owner (24)
- prepend (12)
-
prepend
_ features (12) - prepended (12)
- private (75)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
private
_ methods (12) - protected (48)
-
protected
_ instance _ methods (12) -
protected
_ method _ defined? (12) -
protected
_ methods (12) -
psych
_ yaml _ as (4) - public (75)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ method _ defined? (12) -
public
_ methods (12) -
rake
_ extension (12) -
rb
_ class _ path (12) - rdoc (12)
- refine (12)
-
remove
_ class _ variable (12) -
remove
_ classes _ and _ modules (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) -
respond
_ to? (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby2
_ keywords (18) -
ruby2
_ keywords _ hash? (6) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - sizeof (12)
- struct (12)
-
to
_ enum (48) -
to
_ s (24) -
undef
_ method (12) - union (12)
-
used
_ modules (12) - using (24)
- value (12)
- warn (9)
- xmlrpc (3)
- yaml (12)
-
yaml
_ as (4) - クラス/メソッドの定義 (12)
- 制御構造 (12)
- 演算子式 (12)
検索結果
-
yaml (30.0)
-
構造化されたデータを表現するフォーマットであるYAML (YAML Ain't Markup Language) を扱うためのライブラリです。
...> true
//}
//emlist[例2: 構造化されたハッシュ][ruby]{
require 'yaml'
require 'date'
str_l = <<~YAML_EOT
Tanaka Taro: {age: 35, birthday: 1970-01-01}
Suzuki Suneo: {
age: 13,
birthday: 1992-12-21
}
YAML_EOT
str_r = {}
str_r["Tanaka Taro"] = {
"age" => 35,
"birthday" =>......Date.new(1970, 1, 1)
}
str_r["Suzuki Suneo"] = {
"age" => 13,
"birthday" => Date.new(1992, 12, 21)
}
p str_r == YAML.load(str_l) # => true
//}
//emlist[例3: 構造化されたログ][ruby]{
require 'yaml'
require 'stringio'
strio_r = StringIO.new(<<~YAML_EOT)
---
time: 2008-02-25 17:03......OS)
---
!ruby/sym :foo
EOS
# => :foo
//}
yaml では、Ruby 向けに以下のローカルタグを扱えます。
* !ruby/array: Array オブジェクト
* !ruby/class: Class オブジェクト
* !ruby/hash: Hash オブジェクト
* !ruby/module: Module オブジェクト
* !ruby/rege... -
NEWS for Ruby 2
. 4 . 0 (24.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...a#values_at は named captures をサポートするようになりました 9179
* Module
* Module#refine 引数としてモジュールを許可するようになりました 12534
* Module.used_modules を追加 7418
* Numeric
* Numeric#finite?, Numeric#infinite? を追加 12039......字として許可しなくなりました 12791
* csv
* liberal_parsing オプションを追加 11839
* ipaddr
* IPAddr#==, IPAddr#<=> で引数のオブジェクトを IPAddr に変換する処理に失敗しても例外が発生しなくなりました
12799
* irb
* Bi......場合、
コンパイルエラーになります。
//emlist{
# 0のクラスはInteger
0.class # => Integer
Fixnum # => Integer
Bignum # => Integer
# 以下の2つは同じ
obj.kind_of?(Fixnum)
obj.kind_of?(Integer)
/* Cレベ... -
xmlrpc (24.0)
-
XML-RPC を扱うためのライブラリです。
...ser)
* xml-scan (XMLScanStreamParser)
* Fastest parser is Expat's XMLStreamParser!
* General
* possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
* Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
* SandStor......r (which is now since 1.8
REXMLStreamParser) and a default XML writer. If you want to use a different
XML parser, then you have to call the <i>set_parser</i> method of
XMLRPC::Client instances or instances of subclasses of
XMLRPC::BasicServer or by editing xmlrpc/config.rb.
Client Example:
req......is ~350 (!) times faster than
NQXMLTreeParser and still ~18 times as fast as XMLTreeParser.
You can change the XML-writer by calling method <i>set_writer</i>.
=== 参考
* http://www.linux.or.jp/JF/JFdocs/XML-RPC-HOWTO/index.html
* http://www.linux.or.jp/JF/JFdocs/XML-RPC-HOWTO/xmlrpc-howto-r... -
制御構造 (18.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...めとする制御構造をクラス設計者が定義する事が出来るものです.
=== 条件分岐
====[a:if] if
//emlist[例][ruby]{
if age >= 12 then
print "adult fee\n"
else
print "child fee\n"
end
gender = if foo.gender == "male" then "male" else "female" end
//}
文法:......り強力なパターンマッチ構文を提供しています。
//emlist[][ruby]{
case {a: 1, b: 2, c: 3}
in a: Integer => m
"matched: #{m}"
else
"not matched"
end
# => "matched: 1"
//}
パターンマッチ構文についてはspec/pattern_matchingで説明しています。
=== 繰り返......文が存在しなかったときの値
はnilです。いずれにしてもensure節の値は無視されます。
d:spec/def#class、d:spec/def#module、d:spec/def#method
などの定義文では、それぞれ
begin なしで rescue, ensure 節を定義でき、これにより例外を処理す... -
演算子式 (18.0)
-
演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond
...**
-(単項)
* / %
+ -
<< >>
&
| ^
> >= < <=
<=> == === != =~ !~
&&
||
.. ...
?......ば「&&」は「||」より優先順位が高いので、以下のように
解釈されます。
//emlist[][ruby]{
a && b || c #=> (a && b) || c
a || b && c #=> a || (b && c)
//}
ほとんどの演算子は特別な形式のメソッド呼び出しですが、一部の
ものは言語に組......のように変換される
p c.foo # => 5
//}
属性は Module#attr を使って同じように定義できます。
//emlist[例][ruby]{
class C
attr :foo, true
end
c = C.new
c.foo = 5 # c.foo=( 5 ) のように変換される
p c.foo # => 5
//}
====[a:selfassign] 自己代入
/...