Class: GeoPattern::Background

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Roles::ComparableMetadata
Defined in:
lib/geo_pattern/background.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Roles::ComparableMetadata

#generator?, included

Constructor Details

#initialize(options) ⇒ Background

Returns a new instance of Background.

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/geo_pattern/background.rb', line 13

def initialize(options)
  @image = options[:image]
  @preset = options[:preset]
  @color = options[:color]
  @generator = options[:generator]

  raise ArgumentError, "Argument color is missing" if @color.nil?
  raise ArgumentError, "Argument image is missing" if @image.nil?
  raise ArgumentError, "Argument preset is missing" if @preset.nil?
  raise ArgumentError, "Argument generator is missing" if @generator.nil?
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



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

def color
  @color
end

#generatorObject (readonly)

Returns the value of attribute generator.



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

def generator
  @generator
end

#imageObject (readonly)

Returns the value of attribute image.



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

def image
  @image
end

#presetObject (readonly)

Returns the value of attribute preset.



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

def preset
  @preset
end