るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils cp_r
  5. fileutils chmod_r

検索結果

<< 1 2 > >>

Net::HTTPGenericRequest#method -> String (21321.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Post.new(uri.request_uri)
r
eq.method # => "POST"
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.method # => "GET"
//}...

Net::HTTPHeader#method -> String (21315.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.method # => "GET"
//}...

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (18113.0)

生の文字列を格納したハッシュを生成します。

...する場合に使用してください。

require
'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json # source sequence is illegal/malformed (JSON::GeneratorError)...

Method#source_location -> [String, Integer] | nil (15226.0)

ソースコードのファイル名と行番号を配列で返します。

...クトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。

@see Proc#source_location

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----

require
'/tmp/foo'

m = Foo.new.method(:foo) #...
...=> #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]

method
(:puts).source_location # => nil
//}...

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

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

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

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

絞り込み条件を変える

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

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

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

//emlist[例][ruby]{
require
"json"...
...puts "test".to_json # => "test"
puts '"'.to_json # => "\""
puts "\\".to_json # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...

UnboundMethod#source_location -> [String, Integer] | nil (9226.0)

ソースコードのファイル名と行番号を配列で返します。

... ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。

//emlist[例][ruby]{
require
'time'

Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/rub...
...y/2.4.0/time.rb", 654]
//}

@see Proc#source_location, Method#source_location...

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

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

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

//emlist[例][ruby]{
require
"json"...
...class Person
attr :name, :age

def initialize(name, age)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}...

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

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

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

//emlist[例][ruby]{
require
"json"...
<< 1 2 > >>