Class: Glib::Json::DynamicText::TextSpec
- Inherits:
-
Struct
- Object
- Struct
- Glib::Json::DynamicText::TextSpec
- Defined in:
- app/controllers/concerns/glib/json/dynamic_text.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#prop ⇒ Object
Returns the value of attribute prop.
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
54 55 56 |
# File 'app/controllers/concerns/glib/json/dynamic_text.rb', line 54 def args @args end |
#prop ⇒ Object
Returns the value of attribute prop
54 55 56 |
# File 'app/controllers/concerns/glib/json/dynamic_text.rb', line 54 def prop @prop end |
#view ⇒ Object
Returns the value of attribute view
54 55 56 |
# File 'app/controllers/concerns/glib/json/dynamic_text.rb', line 54 def view @view end |
Instance Method Details
#substitute_with(text) ⇒ Object
55 56 57 |
# File 'app/controllers/concerns/glib/json/dynamic_text.rb', line 55 def substitute_with(text) view[prop] = text.gsub(/\{\{(\w+)\}\}/) { args.fetch($1, "{{#{$1}}}") } end |