Class: ZPNG::TextChunk
Direct Known Subclasses
Constant Summary collapse
- INTEGER_CLASS =
Fixnum
Constants inherited from Chunk
Chunk::KNOWN_TYPES, Chunk::VALID_SIZE_RANGE
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, #offset, #size, #type
Instance Method Summary collapse
Methods inherited from Chunk
#check, #crc_ok?, #export, #export_data, #fix_crc!, from_stream, #initialize, #valid?
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
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/zpng/text_chunk.rb', line 11 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?(INTEGER_CLASS) 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
29 30 31 |
# File 'lib/zpng/text_chunk.rb', line 29 def to_hash { :keyword => keyword, :text => text} end |