Class: TLAW::Util::Description

Inherits:
String
  • Object
show all
Defined in:
lib/tlaw/util.rb

Overview

Description is just a String subclass with rewritten inspect implementation (useful in irb/pry):

str = "Description of endpoint:\nIt has params:..."
# "Description of endpoint:\nIt has params:..."

TLAW::Util::Description.new(str)
# Description of endpoint:
# It has params:...

TLAW uses it when responds to APIPath.describe.

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Description

Returns a new instance of Description.



30
31
32
# File 'lib/tlaw/util.rb', line 30

def initialize(str)
  super(str.to_s.gsub(/ +\n/, "\n"))
end