Movatterモバイル変換


[0]ホーム

URL:


Libraries »piotrmurach/github(master) »Index (F) »Github »API »Factory

Class: Github::API::Factory

Inherits:
Object
  • Object
  • Github::API::Factory
show all
Defined in:
lib/github_api/api/factory.rb

Class Method Summarycollapse

Class Method Details

.convert_to_constant(classes) ⇒Object

Convert name to constant

2526272829
# File 'lib/github_api/api/factory.rb', line 25defself.convert_to_constant(classes)classes.split('::').inject(Github)do|constant,klass|constant.const_getklassendend

.create_instance(klass, options, &block) ⇒Object

Passes configuration options to instantiated class

18192021
# File 'lib/github_api/api/factory.rb', line 18defself.create_instance(klass,options,&block)options.symbolize_keys!convert_to_constant(klass.to_s).newoptions,&blockend

.new(klass, options = {}, &block) ⇒Object

Instantiates a new github api object

Raises:

  • (ArgumentError)
11121314
# File 'lib/github_api/api/factory.rb', line 11defself.new(klass,options={},&block)returncreate_instance(klass,options,&block)ifklassraiseArgumentError,'must provide API class to be instantiated'end
Generated on Sat Nov 22 08:26:34 2025 byyard 0.9.37 (ruby-3.4.3).

[8]ページ先頭

©2009-2025 Movatter.jp