Class: SamlTool::ErbBuilder
- Inherits:
-
Object
- Object
- SamlTool::ErbBuilder
- Defined in:
- lib/saml_tool/erb_builder.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
- #build_output ⇒ Object
- #erb ⇒ Object
-
#initialize(args) ⇒ ErbBuilder
constructor
A new instance of ErbBuilder.
- #output ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ ErbBuilder
Returns a new instance of ErbBuilder.
20 21 22 23 24 |
# File 'lib/saml_tool/erb_builder.rb', line 20 def initialize(args) @args = args @settings = args[:settings] @template = args[:template] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
14 15 16 |
# File 'lib/saml_tool/erb_builder.rb', line 14 def args @args end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
14 15 16 |
# File 'lib/saml_tool/erb_builder.rb', line 14 def settings @settings end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
14 15 16 |
# File 'lib/saml_tool/erb_builder.rb', line 14 def template @template end |
Class Method Details
.build(args) ⇒ Object
16 17 18 |
# File 'lib/saml_tool/erb_builder.rb', line 16 def self.build(args) new(args).to_s end |
Instance Method Details
#build_output ⇒ Object
34 35 36 |
# File 'lib/saml_tool/erb_builder.rb', line 34 def build_output erb.result settings.send(:binding) end |
#erb ⇒ Object
38 39 40 |
# File 'lib/saml_tool/erb_builder.rb', line 38 def erb ERB.new(template) end |
#output ⇒ Object
30 31 32 |
# File 'lib/saml_tool/erb_builder.rb', line 30 def output @output ||= build_output end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/saml_tool/erb_builder.rb', line 26 def to_s output end |