るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub

検索結果

OpenSSL::SSL::SSLSocket#state -> String (54610.0)

現在の状態をアルファベット 6 文字の文字列で返します。

現在の状態をアルファベット 6 文字の文字列で返します。

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (9664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]...

JSON::State#object_nl -> String (9451.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。

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

json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json_state = JSON:...

JSON::State#object_nl=(string) (9451.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。

@param string JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。

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

json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }]...

JSON::State#space -> String (9451.0)

JSON 形式の文字列のトークン間に挿入する文字列を返します。

JSON 形式の文字列のトークン間に挿入する文字列を返します。

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

json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json_state = JSON::State.new(space: "\t")
json_...

絞り込み条件を変える

JSON::State#space=(string) (9451.0)

JSON 形式の文字列のトークン間に挿入する文字列をセットします。

JSON 形式の文字列のトークン間に挿入する文字列をセットします。

@param string JSON 形式の文字列のトークン間に挿入する文字列を指定します。

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

json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}...

JSON::State#space_before -> String (9451.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列を返します。

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

json_state = JSON::State.new(space_before: "")
json_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

js...

JSON::State#space_before=(string) (9451.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列をセットします。

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。

@param string JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。

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

json_state = JSON::State.new(space_before: "")
json_state.space_before # => ""
puts JSON.gen...

JSON::State#indent=(string) (9433.0)

インデントに使用する文字列をセットします。

インデントに使用する文字列をセットします。

@param string インデントに使用する文字列を指定します。

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

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.indent = "...

JSON::State#array_nl -> String (9415.0)

JSON の配列の後に出力する文字列を返します。

JSON の配列の後に出力する文字列を返します。

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

json_state = JSON::State.new({})
json_state.array_nl # => ""
json_state = JSON::State.new(array_nl: "\n")
json_state.array_nl # => "\n"
//}

絞り込み条件を変える

JSON::State#indent -> String (9379.0)

インデントに使用する文字列を返します。

インデントに使用する文字列を返します。

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

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}

JSON::State#generate(obj) -> String (9307.0)

Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.

Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception.

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

[1, 2, 3].to_json # => "[1,2,3]"
//}

JSON::Generator::GeneratorMethods::FalseClass#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

"false" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

false.to_json # => "false"
//}

JSON::Generator::GeneratorMethods::Float#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

(1.0).to_json # => "1.0"
//}

絞り込み条件を変える

JSON::Generator::GeneratorMethods::Hash#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

person = { "name" => "tanaka", "age" => 19 }
person.to_json # ...

JSON::Generator::GeneratorMethods::Integer#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

10.to_json # => "10"
//}

JSON::Generator::GeneratorMethods::NilClass#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

"null" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

nil.to_json # => "null"
//}

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (664.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby...

JSON::Generator::GeneratorMethods::TrueClass#to_json(state_or_hash = nil) -> String (664.0)

自身から生成した JSON 形式の文字列を返します。

自身から生成した JSON 形式の文字列を返します。

"true" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。

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

true.to_json # => "true"
//}

絞り込み条件を変える

Gem::StreamUI#alert(statement, question = nil) -> String | nil (607.0)

INFO レベルのアラートを表示します。

INFO レベルのアラートを表示します。

@param statement 表示する文字列を指定します。

@param question 必要であれば質問を指定します。

@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。

@see Gem::StreamUI#ask

Gem::StreamUI#alert_error(statement, question = nil) -> String | nil (607.0)

ERROR レベルのアラートを表示します。

ERROR レベルのアラートを表示します。

@param statement 表示する文字列を指定します。

@param question 必要であれば質問を指定します。

@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。

@see Gem::StreamUI#ask

Gem::StreamUI#alert_warning(statement, question = nil) -> String | nil (607.0)

WARNING レベルのアラートを表示します。

WARNING レベルのアラートを表示します。

@param statement 表示する文字列を指定します。

@param question 必要であれば質問を指定します。

@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。

@see Gem::StreamUI#ask

Encoding::Converter#insert_output(string) -> nil (343.0)

変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。

変換器内のバッファに文字列を挿入します。
バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。

変換先がステートフルなエンコーディングであった場合、
挿入された文字列は状態に基づいて変換され、状態を更新します。

このメソッドは変換に際してエラーが発生した際にのみ利用されるべきです。

@param string 挿入する文字列

//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec....