Class: Glyr::Source
- Inherits:
-
Object
- Object
- Glyr::Source
- Defined in:
- lib/glyr/sources.rb
Instance Attribute Summary collapse
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(pointer, provider) ⇒ Source
constructor
A new instance of Source.
- #inspect ⇒ Object
- #key ⇒ Object
- #language_aware? ⇒ Boolean
- #name ⇒ Object (also: #to_s)
- #quality ⇒ Object
- #speed ⇒ Object
- #to_native ⇒ Object
- #to_sym ⇒ Object
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
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
47 48 49 |
# File 'lib/glyr/sources.rb', line 47 def provider @provider end |
Instance Method Details
#inspect ⇒ Object
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 |
#key ⇒ Object
58 59 60 |
# File 'lib/glyr/sources.rb', line 58 def key to_native[:key].chr end |
#language_aware? ⇒ Boolean
70 71 72 |
# File 'lib/glyr/sources.rb', line 70 def language_aware? to_native[:lang_aware] end |
#name ⇒ Object Also known as: to_s
54 55 56 |
# File 'lib/glyr/sources.rb', line 54 def name to_native[:name] end |
#quality ⇒ Object
62 63 64 |
# File 'lib/glyr/sources.rb', line 62 def quality to_native[:quality] end |
#speed ⇒ Object
66 67 68 |
# File 'lib/glyr/sources.rb', line 66 def speed to_native[:speed] end |
#to_native ⇒ Object
80 81 82 |
# File 'lib/glyr/sources.rb', line 80 def to_native @internal end |
#to_sym ⇒ Object
76 77 78 |
# File 'lib/glyr/sources.rb', line 76 def to_sym to_s.to_sym end |