Class: Dao::Errors::Message

Inherits:
String
  • Object
show all
Defined in:
lib/dao/errors.rb

Overview

string message support class - knows when it’s sticky…

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Message

Returns a new instance of Message.



23
24
25
26
27
# File 'lib/dao/errors.rb', line 23

def initialize(*args)
  options = Dao.map_for(args.last.is_a?(Hash) ? args.pop : {})
  replace(args.join(' '))
  @sticky = options[:sticky]
end

Instance Attribute Details

#stickyObject

Returns the value of attribute sticky.



21
22
23
# File 'lib/dao/errors.rb', line 21

def sticky
  @sticky
end

Instance Method Details

#sticky?Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/dao/errors.rb', line 29

def sticky?
  @sticky ||= nil
  !!@sticky
end

#to_sObject



34
35
36
# File 'lib/dao/errors.rb', line 34

def to_s
  self
end