Class: Sofia::Types::Adapter
- Inherits:
-
Object
- Object
- Sofia::Types::Adapter
- Defined in:
- lib/sofia/types/adapter.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
: singleton(Sofia::Adapter::Base).
Instance Method Summary collapse
-
#initialize(adapter = :net_http) ⇒ Adapter
constructor
: (?untyped adapter) -> void.
-
#to_sym ⇒ Object
: -> Symbol.
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
#klass ⇒ Object (readonly)
: singleton(Sofia::Adapter::Base)
9 10 11 |
# File 'lib/sofia/types/adapter.rb', line 9 def klass @klass end |
Instance Method Details
#to_sym ⇒ Object
: -> Symbol
19 20 21 |
# File 'lib/sofia/types/adapter.rb', line 19 def to_sym @name end |