Class: RecordsCount::Message
- Inherits:
-
Object
- Object
- RecordsCount::Message
- Includes:
- ActionView::Helpers::TextHelper
- Defined in:
- lib/records_count.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(payload) ⇒ Message
constructor
A new instance of Message.
- #message ⇒ Object
- #print ⇒ Object
Constructor Details
#initialize(payload) ⇒ Message
20 21 22 |
# File 'lib/records_count.rb', line 20 def initialize(payload) @payload = payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
18 19 20 |
# File 'lib/records_count.rb', line 18 def payload @payload end |
Instance Method Details
#format ⇒ Object
28 29 30 |
# File 'lib/records_count.rb', line 28 def format -> { Colorizer.dark_green(yield) } end |
#message ⇒ Object
24 25 26 |
# File 'lib/records_count.rb', line 24 def " --> #{pluralize(payload[:record_count], payload[:class_name].underscore.humanize.downcase)}" end |
#print ⇒ Object
32 33 34 |
# File 'lib/records_count.rb', line 32 def print Rails.logger.debug(format { }.call) end |