Class: CFnDK::ErbString
- Inherits:
-
Object
- Object
- CFnDK::ErbString
- Defined in:
- lib/cfndk/erb_string.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #append_uuid(glue = '-') ⇒ Object
-
#initialize(str, option) ⇒ ErbString
constructor
A new instance of ErbString.
- #value ⇒ Object
Constructor Details
#initialize(str, option) ⇒ ErbString
Returns a new instance of ErbString.
4 5 6 7 8 |
# File 'lib/cfndk/erb_string.rb', line 4 def initialize(str, option) @erb = ERB.new(str, nil, '-') @properties = option[:properties] @uuid = option[:uuid] end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
3 4 5 |
# File 'lib/cfndk/erb_string.rb', line 3 def properties @properties end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
3 4 5 |
# File 'lib/cfndk/erb_string.rb', line 3 def uuid @uuid end |
Instance Method Details
#append_uuid(glue = '-') ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cfndk/erb_string.rb', line 14 def append_uuid(glue = '-') if uuid glue + uuid else '' end end |
#value ⇒ Object
10 11 12 |
# File 'lib/cfndk/erb_string.rb', line 10 def value @erb.result(binding) end |