Skip to content

Allow non-hash data#8

Merged
vincent-psarga merged 4 commits intoSmartBear:masterfrom
mvz:allow-non-hash-data
Jun 20, 2019
Merged

Allow non-hash data#8
vincent-psarga merged 4 commits intoSmartBear:masterfrom
mvz:allow-non-hash-data

Conversation

@mvz
Copy link
Copy Markdown
Contributor

@mvz mvz commented Dec 18, 2018

Handlebars.js allows passing any object that implements methods that correspond to the requested value keys. This pull request aims to implement similar ability by:

  • Allowing any object passed as data to Template#call
  • Not storing values like this on the data object
  • Carefully checking that both #[] and #has_key? are implemented before using them

mvz added 4 commits December 18, 2018 10:52
The data object should provide access via its methods instead.
This allows more freedom in the passed data object, since it does not
need to support the #[]= method.
@vincent-psarga vincent-psarga merged commit e034b47 into SmartBear:master Jun 20, 2019
@mvz mvz deleted the allow-non-hash-data branch June 20, 2019 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants