Class: TyranoDsl::Elements::Background
- Inherits:
-
Object
- Object
- TyranoDsl::Elements::Background
- 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
- #image_path ⇒ String readonly
- #name ⇒ String readonly
- #target_long_file_name ⇒ String readonly
- #target_short_file_name ⇒ String readonly
Instance Method Summary collapse
-
#initialize(name, image_path, index) ⇒ Background
constructor
A new instance of Background.
Constructor Details
#initialize(name, image_path, index) ⇒ Background
Returns a new instance of Background.
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_path ⇒ String (readonly)
9 10 11 |
# File 'lib/tyrano_dsl/elements/background.rb', line 9 def image_path @image_path end |
#name ⇒ String (readonly)
7 8 9 |
# File 'lib/tyrano_dsl/elements/background.rb', line 7 def name @name end |
#target_long_file_name ⇒ String (readonly)
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_name ⇒ String (readonly)
11 12 13 |
# File 'lib/tyrano_dsl/elements/background.rb', line 11 def target_short_file_name @target_short_file_name end |