Class: Pdfrb::Model::Type::PatternMap

Inherits:
Cos::Dictionary show all
Defined in:
lib/pdfrb/model/type/pattern.rb

Overview

Resources /Pattern dictionary (s7.8.5). Maps resource names to patterns.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Dictionary

#[]=, apply_arlington_definition, arlington_default, arlington_key_to_symbol, arlington_one_type_to_ruby, arlington_required?, arlington_scalar, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, merged_field, own_fields, #pdf_type, register_type, type_map, #validate

Methods included from Cos::ArlingtonBacked

#arlington_object

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#[](name) ⇒ Object



20
21
22
# File 'lib/pdfrb/model/type/pattern.rb', line 20

def [](name)
  value[name.to_sym] || value[name.to_s]
end

#add(name, pattern) ⇒ Object



24
25
26
27
# File 'lib/pdfrb/model/type/pattern.rb', line 24

def add(name, pattern)
  value[name.to_sym] = pattern
  name.to_sym
end

#each_patternObject



29
30
31
32
33
# File 'lib/pdfrb/model/type/pattern.rb', line 29

def each_pattern(&)
  return enum_for(:each_pattern) unless block_given?

  value.each(&)
end

#namesObject



35
36
37
# File 'lib/pdfrb/model/type/pattern.rb', line 35

def names
  value.keys
end