Class: Kno::Helpers
- Inherits:
-
Object
- Object
- Kno::Helpers
- Defined in:
- lib/kno.rb
Instance Method Summary collapse
-
#initialize(persona_id, config) ⇒ Helpers
constructor
A new instance of Helpers.
- #session_button ⇒ Object
Constructor Details
#initialize(persona_id, config) ⇒ Helpers
Returns a new instance of Helpers.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kno.rb', line 6 def initialize(persona_id, config) @persona_id = persona_id @config = config @template = """ <% if @persona_id %> <form action=\"/session/terminate\" method=\"post\"> <button type=\"submit\">Sign out</button> </form> <% else %> <form action=\"/session/new\" method=\"post\"> <script src=\"<%= @config.cdn_host %>/pass.js\" data-site=\"<%= @config.site_token %>\"></script> <button type=\"submit\">Sign in</button> </form> <% end %> """ end |
Instance Method Details
#session_button ⇒ Object
23 24 25 |
# File 'lib/kno.rb', line 23 def () ERB.new(@template).result(binding) end |