Class: Glyr::Source

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pointer, provider) ⇒ Source

Returns a new instance of Source.



49
50
51
52
# File 'lib/glyr/sources.rb', line 49

def initialize (pointer, provider)
	@internal = pointer.is_a?(FFI::Pointer) ? C::SourceInfo.new(pointer) : pointer
	@provider = provider
end

Instance Attribute Details

#providerObject (readonly)

Returns the value of attribute provider.



47
48
49
# File 'lib/glyr/sources.rb', line 47

def provider
  @provider
end

Instance Method Details

#inspectObject



84
85
86
# File 'lib/glyr/sources.rb', line 84

def inspect
	"#<Glyr::Source(#{name}): quality=#{quality} speed=#{speed}#{' language_aware' if language_aware?}>"
end

#keyObject



58
59
60
# File 'lib/glyr/sources.rb', line 58

def key
	to_native[:key].chr
end

#language_aware?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/glyr/sources.rb', line 70

def language_aware?
	to_native[:lang_aware]
end

#nameObject Also known as: to_s



54
55
56
# File 'lib/glyr/sources.rb', line 54

def name
	to_native[:name]
end

#qualityObject



62
63
64
# File 'lib/glyr/sources.rb', line 62

def quality
	to_native[:quality]
end

#speedObject



66
67
68
# File 'lib/glyr/sources.rb', line 66

def speed
	to_native[:speed]
end

#to_nativeObject



80
81
82
# File 'lib/glyr/sources.rb', line 80

def to_native
	@internal
end

#to_symObject



76
77
78
# File 'lib/glyr/sources.rb', line 76

def to_sym
	to_s.to_sym
end