Class: HeyYou::Builder::Nexmo
- Inherits:
-
Base
- Object
- Base
- HeyYou::Builder::Nexmo
- Defined in:
- lib/hey_you/builder/nexmo.rb
Defined Under Namespace
Classes: MissingRequiredParameter
Constant Summary collapse
- LINE_BREAKS_BEFORE_AUTOFILL_HASH =
2
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#is_unicode ⇒ Object
readonly
Returns the value of attribute is_unicode.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
4 5 6 |
# File 'lib/hey_you/builder/nexmo.rb', line 4 def from @from end |
#is_unicode ⇒ Object (readonly)
Returns the value of attribute is_unicode.
4 5 6 |
# File 'lib/hey_you/builder/nexmo.rb', line 4 def is_unicode @is_unicode end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/hey_you/builder/nexmo.rb', line 4 def text @text end |
Instance Method Details
#build ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hey_you/builder/nexmo.rb', line 7 def build @text = interpolate(ch_data.fetch('text'), ) if [:google_autofill_code_hash] @text << "\n" * ([:line_breaks_before_hash] || LINE_BREAKS_BEFORE_AUTOFILL_HASH) @text << "#{[:google_autofill_code_hash]}" end @from = ch_data.fetch('from', nil) @is_unicode = ch_data.fetch('is_unicode', false) rescue KeyError => e fail MissingRequiredParameter, e end |