diff options
| author | Florent Peyraud | 2017-06-20 13:39:53 +0200 |
|---|---|---|
| committer | Florent Peyraud | 2017-06-20 13:39:53 +0200 |
| commit | b749813066da2353dfd5cf938f961234a68153ce (patch) | |
| tree | 1b91a9f154f835b2b73c922e15d01139ddeb79fd /lib | |
| parent | 323934a122b589c8dcff9add8ab20a0f91a2da56 (diff) | |
| parent | bf1136bef6430b16732f42c8ce31ef046fe6e239 (diff) | |
| download | chouette-core-b749813066da2353dfd5cf938f961234a68153ce.tar.bz2 | |
Merge branch 'master' of github.com:AF83/stif-boiv
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/html_element.rb | 15 | ||||
| -rw-r--r-- | lib/link.rb | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/html_element.rb b/lib/html_element.rb new file mode 100644 index 000000000..469fd7565 --- /dev/null +++ b/lib/html_element.rb @@ -0,0 +1,15 @@ +class HTMLElement + def initialize(tag_name, content = nil, options = nil) + @tag_name = tag_name + @content = content + @options = options + end + + def to_html(options = {}) + ApplicationController.helpers.content_tag( + @tag_name, + @content, + @options.merge(options) + ) + end +end diff --git a/lib/link.rb b/lib/link.rb new file mode 100644 index 000000000..7683a808f --- /dev/null +++ b/lib/link.rb @@ -0,0 +1,10 @@ +class Link + attr_reader :content, :href, :method, :data + + def initialize(content: nil, href:, method: nil, data: nil) + @content = content + @href = href + @method = method + @data = data + end +end |
