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)

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

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


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

def color
  @color
end

#generatorObject (readonly)

Returns the value of attribute generator


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

def generator
  @generator
end

#imageObject (readonly)

Returns the value of attribute image


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

def image
  @image
end

#presetObject (readonly)

Returns the value of attribute preset


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

def preset
  @preset
end