Class: Sofia::Types::Client::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/sofia/types/client/adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter = :net_http) ⇒ Adapter

: (?untyped adapter) -> void



13
14
15
16
17
# File 'lib/sofia/types/client/adapter.rb', line 13

def initialize(adapter = :net_http)
  name, klass = validate_and_set(adapter || :net_http)
  @name  = T.let(name, Symbol)
  @klass = T.let(klass, T.class_of(Sofia::Adapter::Base))
end

Instance Attribute Details

#klassObject (readonly)

: singleton(Sofia::Adapter::Base)



10
11
12
# File 'lib/sofia/types/client/adapter.rb', line 10

def klass
  @klass
end

Instance Method Details

#to_symObject

: -> Symbol



20
21
22
# File 'lib/sofia/types/client/adapter.rb', line 20

def to_sym
  @name
end