Class: LinkThumbnailer::Graders::Base

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/link_thumbnailer/graders/base.rb

Direct Known Subclasses

HtmlAttribute, Length, LinkDensity, Position

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description, options = {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
17
# File 'lib/link_thumbnailer/graders/base.rb', line 11

def initialize(description, options = {})
  @config      = ::LinkThumbnailer.page.config
  @description = description
  @options     = options

  super(config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/link_thumbnailer/graders/base.rb', line 9

def config
  @config
end

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/link_thumbnailer/graders/base.rb', line 9

def description
  @description
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/link_thumbnailer/graders/base.rb', line 9

def options
  @options
end

Instance Method Details

#callObject



19
20
21
# File 'lib/link_thumbnailer/graders/base.rb', line 19

def call
  fail NotImplementedError
end

#weightObject



23
24
25
# File 'lib/link_thumbnailer/graders/base.rb', line 23

def weight
  options.fetch(:weigth, 1)
end