Class: Polites::Span::Image

Inherits:
Polites::Span show all
Defined in:
lib/polites/span/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Polites::Span

build

Methods inherited from Node

#text

Constructor Details

#initialize(children, image:, filename: nil, title: nil, description: nil, width: nil, height: nil) ⇒ Image

Returns a new instance of Image.



9
10
11
12
13
14
15
16
17
# File 'lib/polites/span/image.rb', line 9

def initialize(children, image:, filename: nil, title: nil, description: nil, width: nil, height: nil)
  super(children)
  @image = image
  @filename = filename
  @title = title
  @description = description
  @width = width
  @height = height
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def children
  @children
end

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def description
  @description
end

#filenameObject (readonly)

Returns the value of attribute filename.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def filename
  @filename
end

#heightObject (readonly)

Returns the value of attribute height.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def height
  @height
end

#imageObject (readonly)

Returns the value of attribute image.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def image
  @image
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def title
  @title
end

#widthObject (readonly)

Returns the value of attribute width.



7
8
9
# File 'lib/polites/span/image.rb', line 7

def width
  @width
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
26
27
# File 'lib/polites/span/image.rb', line 19

def eql?(other)
  super &&
    image == other.image &&
    filename == other.filename &&
    title == other.title &&
    description == other.description &&
    width == other.width &&
    height == other.height
end