Class: Slideck::Metadata Private

Inherits:
Object
  • Object
show all
Defined in:
lib/slideck/metadata.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Responsible for accessing metadata configuration

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Metadata

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a Metadata instance

Parameters:

  • metadata (Hash{Symbol => Object})

    the metadata configuration



96
97
98
99
100
# File 'lib/slideck/metadata.rb', line 96

def initialize()
  @metadata = 

  freeze
end

Class Method Details

.from(metadata_converter, custom_metadata, metadata_defaults) ⇒ Slideck::Metadata

Create a Metadata instance from slides configuration

Parameters:

Returns:

Raises:



22
23
24
25
26
# File 'lib/slideck/metadata.rb', line 22

def self.from(, , )
  validate_keys(.keys)

  new(.merge(.convert()))
end

Instance Method Details

#==(other) ⇒ Boolean

Determine equivalence with another object

Examples:

 == other

Parameters:

  • other (Object)

    the other object to determine equivalence with

Returns:

  • (Boolean)

    true if this object is equivalent to the other, false otherwise



115
116
117
118
119
120
# File 'lib/slideck/metadata.rb', line 115

def ==(other)
  other.is_a?(self.class) &&
    @metadata.keys.all? do |name|
      send(name) == other.send(name)
    end
end

#alignSlideck::Alignment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The alignment configuration

Returns:



63
# File 'lib/slideck/metadata.rb', line 63

define_meta :align

#eql?(other) ⇒ Boolean

Determine equality with another object

Examples:

.eql?(other)

Parameters:

  • other (Object)

    the other object to determine equality with

Returns:

  • (Boolean)

    true if this object is equal to the other, false otherwise



134
135
136
137
138
139
# File 'lib/slideck/metadata.rb', line 134

def eql?(other)
  instance_of?(other.class) &&
    @metadata.keys.all? do |name|
      send(name).eql?(other.send(name))
    end
end

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The footer configuration

Returns:



68
# File 'lib/slideck/metadata.rb', line 68

define_meta :footer

#hashInteger

Generate hash value of this metadata

Examples:

.hash

Returns:

  • (Integer)


149
150
151
# File 'lib/slideck/metadata.rb', line 149

def hash
  [self.class, *@metadata.keys.map { |name| send(name) }].hash
end

#marginSlideck::Margin

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The margin configuration

Returns:



73
# File 'lib/slideck/metadata.rb', line 73

define_meta :margin

#pagerHash{Symbol => Slideck::Alignment,String}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The pager configuration

Returns:



78
# File 'lib/slideck/metadata.rb', line 78

define_meta :pager

#symbolsHash, ...

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The symbols configuration

Returns:

  • (Hash, String, Symbol)


83
# File 'lib/slideck/metadata.rb', line 83

define_meta :symbols

#themeHash{Symbol => Array, String, Symbol}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The theme configuration

Returns:

  • (Hash{Symbol => Array, String, Symbol})


88
# File 'lib/slideck/metadata.rb', line 88

define_meta :theme