Class: OpenXml::ContentTypesPresets

Inherits:
Object
  • Object
show all
Defined in:
lib/openxml/content_types_presets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContentTypesPresets

Returns a new instance of ContentTypesPresets.


5
6
7
# File 'lib/openxml/content_types_presets.rb', line 5

def initialize
  @defaults, @overrides = {}, {}
end

Instance Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults


3
4
5
# File 'lib/openxml/content_types_presets.rb', line 3

def defaults
  @defaults
end

#overridesObject (readonly)

Returns the value of attribute overrides


3
4
5
# File 'lib/openxml/content_types_presets.rb', line 3

def overrides
  @overrides
end

Instance Method Details

#default(extension, content_type) ⇒ Object


9
10
11
# File 'lib/openxml/content_types_presets.rb', line 9

def default(extension, content_type)
  defaults[extension] = content_type
end

#override(part_name, content_type) ⇒ Object


13
14
15
# File 'lib/openxml/content_types_presets.rb', line 13

def override(part_name, content_type)
  overrides[part_name] = content_type
end