Module: It
- Defined in:
- lib/it.rb,
lib/it/tag.rb,
lib/it/link.rb,
lib/it/plain.rb,
lib/it/helper.rb,
lib/it/parser.rb,
lib/it/interpolation.rb
Overview
Namespace of the gem.
Defined Under Namespace
Modules: Helper Classes: Interpolation, Link, Parser, Plain, Tag
Class Method Summary collapse
-
.it(identifier, options = {}) ⇒ Object
It outside of your views.
-
.link(href, options = {}) ⇒ Object
Creates a new link to be used in
it
. -
.plain(template = "%s") ⇒ Object
Creates a new plain replacement to be used in
it
. -
.tag(tag_name, options = {}) ⇒ Object
Creates a new tag to be used in
it
.
Class Method Details
.it(identifier, options = {}) ⇒ Object
It outside of your views. See documentation at Helper#it
15 16 17 18 |
# File 'lib/it.rb', line 15 def self.it(identifier, = {}) .stringify_keys! Parser.new(I18n.t(identifier, :locale => ["locale"]), ).process end |
.link(href, options = {}) ⇒ Object
Creates a new link to be used in it
.
-
href
: The url for the link. You may specify it as a String or as a named route likearticle_path
. It’s not possible to specify a Hash like{:controller => "articles", :action => "index"}
directly. Use theurl_for
helper, if you would like to specify your links like that. -
options
: The options as an Hash. Use them like you would withlink_to
. (optional)
26 27 28 |
# File 'lib/it.rb', line 26 def self.link(href, = {}) It::Link.new(href, ) end |
.plain(template = "%s") ⇒ Object
Creates a new plain replacement to be used in it
.
-
template
: A string to be used as the template. An example would be"%s[http://www.rubyonrails.org]"
. Defaults to"%s"
. (optional)
34 35 36 |
# File 'lib/it.rb', line 34 def self.plain(template = "%s") It::Plain.new(template) end |