Class: ZPNG::TextChunk
Direct Known Subclasses
Instance Attribute Summary collapse
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from Chunk
#crc, #data, #idx, #size, #type
Instance Method Summary collapse
Methods inherited from Chunk
#crc_ok?, #export, #export_data, #fix_crc!, from_stream, #initialize
Methods included from DeepCopyable
Constructor Details
This class inherits a constructor from ZPNG::Chunk
Instance Attribute Details
#keyword ⇒ Object
Returns the value of attribute keyword.
3 4 5 |
# File 'lib/zpng/text_chunk.rb', line 3 def keyword @keyword end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/zpng/text_chunk.rb', line 3 def text @text end |
Instance Method Details
#inspect(verbosity = 10) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/zpng/text_chunk.rb', line 5 def inspect verbosity = 10 vars = %w'keyword text language translated_keyword cmethod cflag' vars -= %w'text translated_keyword' if verbosity <=0 super.sub(/ *>$/,'') + ", " + vars.map do |var| t = instance_variable_get("@#{var}") unless t.is_a?(Fixnum) t = t.to_s t = t[0..20] + "..." if t.size > 20 end if t.nil? || t == '' nil else "#{var.to_s.tr('@','')}=#{t.inspect}" end end.compact.join(", ") + ">" end |
#to_hash ⇒ Object
23 24 25 |
# File 'lib/zpng/text_chunk.rb', line 23 def to_hash { :keyword => keyword, :text => text} end |