Class: ATSPI::Accessible::Text::Character
- Inherits:
-
Object
- Object
- ATSPI::Accessible::Text::Character
- Defined in:
- lib/atspi/accessible/text/character.rb
Overview
Represents a single character in a ATSPI::Accessible::Text.
Attributes collapse
-
#extents(relative_to:) ⇒ Extents
Its extents.
-
#length ⇒ 1
Its length.
Representations collapse
-
#inspect ⇒ String
Itself as an inspectable string.
-
#to_s ⇒ String
Its string representation.
Instance Method Details
#extents(relative_to:) ⇒ Extents
Returns its extents.
24 25 26 |
# File 'lib/atspi/accessible/text/character.rb', line 24 def extents(relative_to:) Extents.new(@native.character_extents(@offset, relative_to)) end |
#inspect ⇒ String
Returns itself as an inspectable string.
38 39 40 41 |
# File 'lib/atspi/accessible/text/character.rb', line 38 def inspect "#<#{self.class.name}:0x#{'%x14' % __id__} @to_s=#{to_s.inspect} @length=#{length} " << "@offset=#{@offset} @extents=#{extents(relative_to: :screen).inspect}>" end |
#length ⇒ 1
Returns its length.
13 14 15 |
# File 'lib/atspi/accessible/text/character.rb', line 13 def length 1 end |
#to_s ⇒ String
Returns its string representation.
33 34 35 |
# File 'lib/atspi/accessible/text/character.rb', line 33 def to_s [@native.character_at_offset(@offset)].pack("U") # UCS-4 codepoint to readable character end |