Class: Glyr::Provider
- Inherits:
-
Object
- Object
- Glyr::Provider
- Defined in:
- lib/glyr/providers.rb
Instance Method Summary collapse
-
#initialize(pointer, providers) ⇒ Provider
constructor
A new instance of Provider.
- #inspect ⇒ Object
- #name ⇒ Object (also: #to_s)
- #requirements ⇒ Object
- #sources ⇒ Object
- #to_native ⇒ Object
- #type ⇒ Object (also: #to_sym)
Constructor Details
#initialize(pointer, providers) ⇒ Provider
Returns a new instance of Provider.
62 63 64 65 |
# File 'lib/glyr/providers.rb', line 62 def initialize (pointer, providers) @internal = pointer.is_a?(FFI::Pointer) ? C::FetcherInfo.new(pointer) : pointer @providers = providers end |
Instance Method Details
#inspect ⇒ Object
91 92 93 |
# File 'lib/glyr/providers.rb', line 91 def inspect "#<Glyr::Provider(#{name}): #{requirements}>" end |
#name ⇒ Object Also known as: to_s
67 68 69 |
# File 'lib/glyr/providers.rb', line 67 def name to_native[:name] end |
#requirements ⇒ Object
75 76 77 |
# File 'lib/glyr/providers.rb', line 75 def requirements FieldRequirements[to_native[:reqs]] end |
#sources ⇒ Object
79 80 81 |
# File 'lib/glyr/providers.rb', line 79 def sources Sources.new(to_native[:head], self) end |
#to_native ⇒ Object
87 88 89 |
# File 'lib/glyr/providers.rb', line 87 def to_native @internal end |
#type ⇒ Object Also known as: to_sym
71 72 73 |
# File 'lib/glyr/providers.rb', line 71 def type to_native[:type] end |