Class: SamlTool::ErbBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/saml_tool/erb_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



14
15
16
# File 'lib/saml_tool/erb_builder.rb', line 14

def args
  @args
end

#settingsObject (readonly)

Returns the value of attribute settings.



14
15
16
# File 'lib/saml_tool/erb_builder.rb', line 14

def settings
  @settings
end

#templateObject (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_outputObject



34
35
36
# File 'lib/saml_tool/erb_builder.rb', line 34

def build_output
  erb.result settings.send(:binding)
end

#erbObject



38
39
40
# File 'lib/saml_tool/erb_builder.rb', line 38

def erb
  ERB.new(template)
end

#outputObject



30
31
32
# File 'lib/saml_tool/erb_builder.rb', line 30

def output
  @output ||= build_output
end

#to_sObject



26
27
28
# File 'lib/saml_tool/erb_builder.rb', line 26

def to_s
  output
end