REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.68 KB
Close
//proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/ERB/new-c.yaml
Text
Base64
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Constructs a new ERB object with the template specified in <em>str</em>. - !ruby/struct:SM::Flow::P body: An ERB object works by building a chunk of Ruby code that will output the completed template when run. If <em>safe_level</em> is set to a non-nil value, ERB code will be run in a separate thread with <b>$SAFE</b> set to the provided level. - !ruby/struct:SM::Flow::P body: "If <em>trim_mode</em> is passed a String containing one or more of the following modifiers, ERB will adjust its code generation as listed:" - !ruby/struct:SM::Flow::VERB body: " % enables Ruby code processing for lines beginning with %\n <> omit newline for lines starting with <% and ending in %>\n > omit newline for lines ending in %>\n" - !ruby/struct:SM::Flow::P body: <em>eoutvar</em> can be used to set the name of the variable ERB will build up its output in. This is useful when you need to run multiple ERB templates through the same binding and/or when you want to control where output ends up. Pass the name of the variable to be used inside a String. - !ruby/struct:SM::Flow::H level: 3 text: Example - !ruby/struct:SM::Flow::VERB body: " require "erb"\n\n # build data class\n class Listings\n PRODUCT = { :name => "Chicken Fried Steak",\n :desc => "A well messages pattie, breaded and fried.",\n :cost => 9.95 }\n\n attr_reader :product, :price\n\n def initialize( product = "", price = "" )\n @product = product\n @price = price\n end\n\n def build\n b = binding\n # create and run templates, filling member data variables\n ERB.new(<<-'END_PRODUCT'.gsub(/^\\s+/, ""), 0, "", "@product").result b\n <%= PRODUCT[:name] %>\n <%= PRODUCT[:desc] %>\n END_PRODUCT\n ERB.new(<<-'END_PRICE'.gsub(/^\\s+/, ""), 0, "", "@price").result b\n <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>\n <%= PRODUCT[:desc] %>\n END_PRICE\n end\n end\n\n # setup template data\n listings = Listings.new\n listings.build\n\n puts listings.product + "\\n" + listings.price\n" - !ruby/struct:SM::Flow::P body: <em>Generates</em> - !ruby/struct:SM::Flow::VERB body: " Chicken Fried Steak\n A well messages pattie, breaded and fried.\n\n Chicken Fried Steak -- 9.95\n A well messages pattie, breaded and fried.\n" full_name: ERB::new is_singleton: true name: new params: (str, safe_level=nil, trim_mode=nil, eoutvar='_erbout') visibility: public
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 3 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Compiler
DIR
-
drwxr-xr-x
2024-03-03 22:50:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DefMethod
DIR
-
drwxr-xr-x
2024-03-03 22:50:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Util
DIR
-
drwxr-xr-x
2024-03-03 22:50:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cdesc-ERB.yaml
8.96 KB
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
def_class-i.yaml
750 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
def_method-i.yaml
630 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
def_module-i.yaml
643 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
new-c.yaml
2.68 KB
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
result-i.yaml
537 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
run-i.yaml
261 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
set_eoutvar-i.yaml
437 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
version-c.yaml
253 B
lrw-r--r--
2023-07-26 13:47:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).