Class: Sofia::Types::Adapter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter = :net_http) ⇒ Adapter

: (?untyped adapter) -> void



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

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)



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

def klass
  @klass
end

Instance Method Details

#to_symObject

: -> Symbol



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

def to_sym
  @name
end