Class: GnomeWallpaperSlideshow::Wallpaper

Inherits:
Object
  • Object
show all
Defined in:
lib/gnome-wallpaper-slideshow/wallpaper.rb

Overview

Represents a wallpaper entry in a slideshow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, duration = 1795.0, transition_time = 5.0) ⇒ Wallpaper

Create a new wallpaper

Parameters:

  • filename (String)

    The path to the image file

  • duration (Float) (defaults to: 1795.0)

    The length of time this wallpaper will be displayed in seconds

  • transition_time (Float) (defaults to: 5.0)

    The amount of time spent transitioning to the next wallpaper in seconds



10
11
12
13
14
# File 'lib/gnome-wallpaper-slideshow/wallpaper.rb', line 10

def initialize(filename, duration = 1795.0, transition_time = 5.0)
  @filename = filename
  @duration = duration
  @transition_time = transition_time
end

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



3
4
5
# File 'lib/gnome-wallpaper-slideshow/wallpaper.rb', line 3

def duration
  @duration
end

#filenameObject

Returns the value of attribute filename.



3
4
5
# File 'lib/gnome-wallpaper-slideshow/wallpaper.rb', line 3

def filename
  @filename
end

#transition_timeObject

Returns the value of attribute transition_time.



3
4
5
# File 'lib/gnome-wallpaper-slideshow/wallpaper.rb', line 3

def transition_time
  @transition_time
end

Instance Method Details

#==(other) ⇒ Object



16
17
18
# File 'lib/gnome-wallpaper-slideshow/wallpaper.rb', line 16

def ==(other)
    (self.filename == other.filename) && (self.duration == other.duration) && (self.transition_time == other.transition_time)
end