るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.090秒)
トップページ > クエリ:i[x] > クエリ:end[x] > クエリ:attr[x] > クエリ:new[x] > ライブラリ:erb[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. matchdata end

クラス

検索結果

ERB.new(str, safe_level=NOT_GIVEN, trim_mode=NOT_GIVEN, eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout') -> ERB (18469.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...eRubyスクリプト から ERB オブジェクトを生成して返します。

@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション

@param eoutvar eRuby...
...

//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }

attr
_reader :product, :price

def initialize( product = "", price = "" )...
...t
@price = price
end


def build
b = binding
# create and run templates, filling member data variables
ERB
.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END
_PRODUCT
ERB
.new(<<~'END_PRICE', eoutvar: "@price").res...

ERB.new(str, safe_level=nil, trim_mode=nil, eoutvar=&#39;_erbout&#39;) -> ERB (18369.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...eRubyスクリプト から ERB オブジェクトを生成して返します。

@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション

@param eoutvar eRuby...
...

//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }

attr
_reader :product, :price

def initialize( product = "", price = "" )...
...uct
@price = price
end


def build
b = binding
# create and run templates, filling member data variables
ERB
.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END
_PRODUCT
ERB
.new(<<-'END_PRICE'.gsub(/...

ERB.new(str, trim_mode: nil, eoutvar: &#39;_erbout&#39;) -> ERB (18269.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...eRubyスクリプト から ERB オブジェクトを生成して返します。

@param str eRubyスクリプトを表す文字列
@param trim_mode 整形の挙動を変更するオプション

@param eoutvar eRubyスクリプトの中で出力をためていく変数の名前を表す文...
...


//emlist[例][ruby]{
require "erb"

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",
:desc => "A well messages pattie, breaded and fried.",
:cost => 9.95 }

attr
_reader :product, :price

def initialize( product = "", price = "" )...
...t
@price = price
end


def build
b = binding
# create and run templates, filling member data variables
ERB
.new(<<~'END_PRODUCT', eoutvar: "@product").result b
<%= PRODUCT[:name] %>
<%= PRODUCT[:desc] %>
END
_PRODUCT
ERB
.new(<<~'END_PRICE', eoutvar: "@price").res...