るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 > >>

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

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

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

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

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

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

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

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

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

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

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

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

...@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
//}...

ERB#def_method(mod, methodname, fname=&#39;(ERB)&#39;) -> nil (6214.0)

変換した Ruby スクリプトをメソッドとして定義します。

...指定し、メソッド名は methodname で指定します。
fname はスクリプトを定義する際のファイル名です。主にエラー時に活躍します。

@param mod メソッドを定義するモジュール(またはクラス)

@param methodname メソッド名

@param fname...
...スクリプトを定義する際のファイル名

例:

require
'erb'
erb = ERB.new(script)
erb.def_method(MyClass, 'foo(bar)', 'foo.erb')...

RDoc::Context#initialize_methods_etc -> () (6117.0)

追加されたメソッド、属性、alias されたメソッド(メソッド名の対応が取れて いないものを含む)、require されたファイル、include されたファイル、定数 をクリアします。

...追加されたメソッド、属性、alias されたメソッド(メソッド名の対応が取れて
いないものを含む)、require されたファイル、include されたファイル、定数
をクリアします。...

絞り込み条件を変える

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

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

...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/ruby/2.4.0/time.rb", 654]
//}

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

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

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

...例][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::Array#to_json(state_or_hash = nil) -> String (3007.0)

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

...N 形式の文字列をカスタマイズするため
に 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 (3007.0)

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

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

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

false.to_json # => "false"
//}...
<< 1 2 3 > >>