Class: Middleman::Presentation::SlideName

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-presentation-core/slide_name.rb

Overview

Determine slide name base on old slide

Instance Method Summary collapse

Constructor Details

#initialize(old_slide, base_name:, type:) ⇒ SlideName

Create new instance

Parameters:

  • old_slide (ExistingSlide)

    The old slide which should be used

  • base_name (String)

    The requested new base of the file name

  • type (String)

    The requested new type for the slide name



22
23
24
25
26
# File 'lib/middleman-presentation-core/slide_name.rb', line 22

def initialize(old_slide, base_name:, type:)
  @old_slide = old_slide
  @base_name = base_name
  @type      = type
end

Instance Method Details

#to_sObject

Return the string version of slide name



29
30
31
32
33
# File 'lib/middleman-presentation-core/slide_name.rb', line 29

def to_s
  return determine_base_name + guess_type if base_name.blank? && type.blank?

  determine_base_name + determine_type
end