Class: Unmagic::Browser::Console::Tagged
- Inherits:
-
String
- Object
- String
- Unmagic::Browser::Console::Tagged
- Defined in:
- lib/unmagic/browser/console/values.rb
Overview
A String that also knows how it wants to be shown.
Sniffing a value to guess whether it's HTML, Markdown or PNG bytes would
be guesswork the console doesn't need to do: the helper that produced it
knows exactly what it asked for. These carry that answer through to the
renderer while staying plain Strings for everything else, so
html.include?("...") and puts markdown work the way you'd expect.
Instance Attribute Summary collapse
- #name ⇒ String readonly
Instance Method Summary collapse
-
#initialize(value, name:) ⇒ Tagged
constructor
A new instance of Tagged.
Constructor Details
#initialize(value, name:) ⇒ Tagged
Returns a new instance of Tagged.
16 17 18 19 |
# File 'lib/unmagic/browser/console/values.rb', line 16 def initialize(value, name:) super(value.to_s) @name = name end |
Instance Attribute Details
#name ⇒ String (readonly)
22 23 24 |
# File 'lib/unmagic/browser/console/values.rb', line 22 def name @name end |