Class: TLAW::Util::Description
- Inherits:
-
String
- Object
- String
- TLAW::Util::Description
- 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
-
#initialize(str) ⇒ Description
constructor
A new instance of Description.
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 |