Module: Wayfarer::Stringify::InstanceMethods
- Defined in:
- lib/wayfarer/stringify.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #class_name ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Instance Method Details
#attributes ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/wayfarer/stringify.rb', line 31 def attributes self.class .stringified_attributes .map { |attr| [attr, public_send(attr)] } .to_h .map { |k, v| [k, "=", v.inspect].join } .join(", ") end |
#class_name ⇒ Object
27 28 29 |
# File 'lib/wayfarer/stringify.rb', line 27 def class_name self.class.name.split("::").last end |
#to_s ⇒ Object Also known as: inspect
21 22 23 |
# File 'lib/wayfarer/stringify.rb', line 21 def to_s "#<#{class_name} #{attributes}>" end |