るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle type_size_t

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

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

__END__
{
"Tanaka": {
"name":"tanaka",...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (15319.0)

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

...す。

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

@return デフォ...
...TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は空配列を返します。

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

WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返されたインターフェイスが選択されます。

次のサンプル...

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

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

...nil を返します。

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

T
ime.instance_method(:zone).source_location # => nil
T
ime.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 (12226.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
//...

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

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

...UTF-8 の文字列ではなく生の文字列を JSON に変換する場合に使用してください。

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)...

絞り込み条件を変える

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

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

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

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

@param version_requirement

@see Gem::Requirement...

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

現在のソースをパースして結果を 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_class: Person)
person = parser.parse
person.class # => Person
person.name # => "tanaka"
person...
....age # => 20

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

@see JSON::Parser#source...