ratchet v0.4.1 Ratchet.EEx

Generates EEx in compiled Ratchet templates

Summary

Functions

Build an EEx statement fetching attributes

Spit out an EEx ending

Build an EEx list comprehension from a scope and a property

Build an EEx statement fetching content

Functions

eex_attributes(property, attributes)

Build an EEx statement fetching attributes

iex> Ratchet.EEx.eex_attributes("lolwat", [])
"<%= Ratchet.Template.attributes(lolwat, []) %>"
eex_close()

Spit out an EEx ending

eex_comprehension_open(scope, property)

Build an EEx list comprehension from a scope and a property

iex> Ratchet.EEx.eex_comprehension_open("foo", "bar")
"<%= for bar <- Ratchet.Template.property(foo, :bar) |> Ratchet.Template.prepare do %>"
eex_content(property, default)

Build an EEx statement fetching content

iex> Ratchet.EEx.eex_content("lolwat", ["Content"])
[
  "<%= if Ratchet.Template.content?(lolwat) do %>",
  "<%= Ratchet.Template.content(lolwat) %>",
  "<% else %>",
  "Content",
  "<% end %>",
]