Class: Headline

Inherits:
Object
  • Object
show all
Includes:
Lengthable
Defined in:
lib/ipsummer/headline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Lengthable

#length, #length_max, #length_min, #max_no_min?, #min_and_max?, #min_no_max?

Constructor Details

#initialize(options = {}) ⇒ Headline

Returns a new instance of Headline.



9
10
11
12
13
14
# File 'lib/ipsummer/headline.rb', line 9

def initialize(options={})
  @level = options[:level]
  @min = options[:min_words]
  @max = options[:max_words]
  @period = options[:period] || false
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



7
8
9
# File 'lib/ipsummer/headline.rb', line 7

def level
  @level
end

#maxObject (readonly)

Returns the value of attribute max.



7
8
9
# File 'lib/ipsummer/headline.rb', line 7

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



7
8
9
# File 'lib/ipsummer/headline.rb', line 7

def min
  @min
end

#periodObject (readonly)

Returns the value of attribute period.



7
8
9
# File 'lib/ipsummer/headline.rb', line 7

def period
  @period
end

Instance Method Details

#unwrapped_headlineObject



20
21
22
# File 'lib/ipsummer/headline.rb', line 20

def unwrapped_headline
  complete_headline
end

#wrapped_headlineObject



16
17
18
# File 'lib/ipsummer/headline.rb', line 16

def wrapped_headline
  unescaped "<#{heading}>#{unwrapped_headline}</#{heading}>"
end