Class: Addic7ed::Addic7edCommentNormalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/addic7ed/services/addic7ed_comment_normalizer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comment) ⇒ Addic7edCommentNormalizer

Returns a new instance of Addic7edCommentNormalizer.



5
6
7
# File 'lib/addic7ed/services/addic7ed_comment_normalizer.rb', line 5

def initialize(comment)
  @comment = comment || ""
end

Instance Attribute Details

#commentObject (readonly)

Returns the value of attribute comment.



3
4
5
# File 'lib/addic7ed/services/addic7ed_comment_normalizer.rb', line 3

def comment
  @comment
end

Class Method Details

.call(comment) ⇒ Object



9
10
11
# File 'lib/addic7ed/services/addic7ed_comment_normalizer.rb', line 9

def self.call(comment)
  new(comment).call
end

Instance Method Details

#callObject



13
14
15
# File 'lib/addic7ed/services/addic7ed_comment_normalizer.rb', line 13

def call
  comment.downcase
end