るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

JSON::Parser#source -> String (18114.0)

現在のソースのコピーを返します。

...現在のソースのコピーを返します。

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

parser = JSON::Parser.new(DATA.read)
print parser.source

# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
#...

UnboundMethod#source_location -> [String, Integer] | nil (6132.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...

Method#source_location -> [String, Integer] | nil (6126.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...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (6119.0)

型が持つソースインターフェイスを取得します。

...型が持つソースインターフェイスを取得します。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン...
...ない場合は空配列を返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
tobj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]

WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返されたイ...
...ding : cp932
require
'win32ole'

type = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source
= type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
end
attr_reader :completed
end
source
.ole_methods...

Gem::SourceIndex#find_name(gem_name, version_requirement = Gem::Requirement.default) -> Gem::Specification (3201.0)

短い名前で正確にマッチする Gem を返します。

...短い名前で正確にマッチする Gem を返します。

@param gem_name Gem の名前を指定します。

@param version_requirement

@see Gem::Requirement...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (13.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::GeneratorEr...

JSON::Parser#parse -> object (13.0)

現在のソースをパースして結果を Ruby のオブジェクトとして返します。

...現在のソースをパースして結果を Ruby のオブジェクトとして返します。

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

class Person
attr_accessor :name, :age

def []=(key, value)
instance_variable_set("@#{key}", value)
end
end

parser = JSON::Parser.new(DATA.read, object_c...
...lass: Person)
person = parser.parse
person.class # => Person
person.name # => "tanaka"
person.age # => 20

__END__
{
"name":"tanaka",
"age":20
}
//}

@see JSON::Parser#source...