102件ヒット
[1-100件を表示]
(0.094秒)
クラス
-
CSV
:: Table (12) -
Scanf
:: FormatString (18) - String (12)
- UnboundMethod (36)
モジュール
-
Net
:: HTTPHeader (24)
キーワード
- arity (12)
-
basic
_ auth (12) - inspect (24)
-
matched
_ count (6) -
proxy
_ basic _ auth (12) - prune (6)
-
spec
_ count (6) -
to
_ s (12)
検索結果
先頭5件
-
String
# count(*chars) -> Integer (39132.0) -
chars で指定された文字が文字列 self にいくつあるか数えます。
...文字のパターン
//emlist[例][ruby]{
p 'abcdefg'.count('c') # => 1
p '123456789'.count('2378') # => 4
p '123456789'.count('2-8', '^4-6') # => 4
# ファイルの行数を数える
n_lines = File.read("foo").count("\n")
# ファイルの末尾に改行コードがな......い場合にも対処する
buf = File.read("foo")
n_lines = buf.count("\n")
n_lines += 1 if /[^\n]\z/ =~ buf
# if /\n\z/ !~ buf だと空ファイルを 1 行として数えてしまうのでダメ
//}... -
Scanf
:: FormatString # matched _ count (9102.0) -
@todo
@todo -
Scanf
:: FormatString # spec _ count (9102.0) -
@todo
@todo -
Scanf
:: FormatString # prune(n=matched _ count) (3102.0) -
@todo
@todo -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (202.0) -
Authorization: ヘッダを BASIC 認証用にセットします。
...Authorization: ヘッダを BASIC 認証用にセットします。
@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net:... -
Net
:: HTTPHeader # proxy _ basic _ auth(account , password) -> [String] (202.0) -
Proxy 認証のために Proxy-Authorization: ヘッダをセットします。
...@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "pass... -
UnboundMethod
# inspect -> String (127.0) -
self を読みやすい文字列として返します。
...self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect... -
UnboundMethod
# to _ s -> String (127.0) -
self を読みやすい文字列として返します。
...self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect... -
CSV
:: Table # inspect -> String (108.0) -
モードとサイズを US-ASCII な文字列で返します。
...モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}... -
UnboundMethod
# arity -> Integer (31.0) -
メソッドが受け付ける引数の数を返します。
...).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3
String.instance_method(:size).arity #=> 0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=> -1
//}...