Class: TyranoDsl::Elements::Background

Inherits:
Object
  • Object
show all
Defined in:
lib/tyrano_dsl/elements/background.rb

Overview

A declared background

Constant Summary collapse

BACKGROUND_DIRECTORY =
File.join('data', 'bgimage')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, image_path, index) ⇒ Background

Returns a new instance of Background.

Parameters:

  • name (String)
  • image_path (String)
  • index (Integer)


20
21
22
23
24
25
26
27
28
29
# File 'lib/tyrano_dsl/elements/background.rb', line 20

def initialize(name, image_path, index)
  @name = name
  @image_path = image_path
  @index = index
  @target_short_file_name = "#{index}#{File.extname(image_path)}"
  @target_long_file_name = File.join(
      BACKGROUND_DIRECTORY,
      @target_short_file_name
  )
end

Instance Attribute Details

#image_pathString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/tyrano_dsl/elements/background.rb', line 9

def image_path
  @image_path
end

#nameString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/tyrano_dsl/elements/background.rb', line 7

def name
  @name
end

#target_long_file_nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/tyrano_dsl/elements/background.rb', line 13

def target_long_file_name
  @target_long_file_name
end

#target_short_file_nameString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/tyrano_dsl/elements/background.rb', line 11

def target_short_file_name
  @target_short_file_name
end