Class: Glyr::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/glyr/providers.rb

Instance Method Summary collapse

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

#inspectObject



91
92
93
# File 'lib/glyr/providers.rb', line 91

def inspect
	"#<Glyr::Provider(#{name}): #{requirements}>"
end

#nameObject Also known as: to_s



67
68
69
# File 'lib/glyr/providers.rb', line 67

def name
	to_native[:name]
end

#requirementsObject



75
76
77
# File 'lib/glyr/providers.rb', line 75

def requirements
	FieldRequirements[to_native[:reqs]]
end

#sourcesObject



79
80
81
# File 'lib/glyr/providers.rb', line 79

def sources
	Sources.new(to_native[:head], self)
end

#to_nativeObject



87
88
89
# File 'lib/glyr/providers.rb', line 87

def to_native
	@internal
end

#typeObject Also known as: to_sym



71
72
73
# File 'lib/glyr/providers.rb', line 71

def type
	to_native[:type]
end