Class: Pdfrb::Model::Type::Namespace

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

Overview

Namespace dictionary (s14.7.6.1, PDF 2.0). Namespaces for structure element types in tagged PDF documents.

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

#has_role_map?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pdfrb/model/type/namespace.rb', line 16

def has_role_map?
  !!role_map_ns
end

#mapped_role(custom_name) ⇒ Object



20
21
22
23
24
# File 'lib/pdfrb/model/type/namespace.rb', line 20

def mapped_role(custom_name)
  return nil unless role_map_ns.is_a?(Hash)

  role_map_ns[custom_name.to_sym] || role_map_ns[custom_name.to_s]
end

#namespace_nameObject



13
# File 'lib/pdfrb/model/type/namespace.rb', line 13

def namespace_name; self[:NS]; end

#role_map_nsObject



14
# File 'lib/pdfrb/model/type/namespace.rb', line 14

def role_map_ns; self[:RoleMapNS]; end

#typeObject



12
# File 'lib/pdfrb/model/type/namespace.rb', line 12

def type; self[:Type]; end