Module: Cyberweb::Objectified::ShorterHelperMethods
- Defined in:
- lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb
Overview
Cyberweb::Objectified::ShorterHelperMethods
Class Method Summary
collapse
Instance Method Summary
collapse
-
#html_a(i = ARGV) ⇒ Object
(also: #oop_a)
# === html_a (a tag) ========================================================================= #.
-
#html_abbr(i = ARGV) ⇒ Object
(also: #oop_abbr)
# === html_abbr ========================================================================= #.
-
#html_audio(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_audio)
# === html_audio ========================================================================= #.
-
#html_blockquote(i = ARGV) ⇒ Object
(also: #oop_blockquote)
# === html_blockquote ========================================================================= #.
-
#html_body(i = '') ⇒ Object
(also: #oop_body)
# === html_body ========================================================================= #.
-
#html_button(use_this_text = '', optional_css_class = Button.css_class?, optional_id = nil, optional_css_style = nil) ⇒ Object
(also: #oop_button)
-
#html_canvas(i = ARGV) ⇒ Object
(also: #oop_canvas)
# === html_canvas ========================================================================= #.
-
#html_checkbox(i = ARGV) ⇒ Object
# === html_checkbox ========================================================================= #.
-
#html_cite(i = '') ⇒ Object
(also: #oop_cite)
# === html_cite ========================================================================= #.
-
#html_combobox(i = ARGV) ⇒ Object
(also: #html_dropbox, #oop_combobox)
# === html_combobox.
-
#html_div(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_div)
# === html_div ========================================================================= #.
-
#html_embed(i = ARGV) ⇒ Object
(also: #oop_embed)
# === html_embed ========================================================================= #.
-
#html_fieldset(i = '') ⇒ Object
(also: #oop_fieldset)
# === html_fieldset ========================================================================= #.
-
#html_figure(i = ARGV) ⇒ Object
(also: #oop_figure)
-
#html_form(i = ARGV) ⇒ Object
(also: #oop_form)
-
#html_h1(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_h1)
# === html_h1 ========================================================================= #.
-
#html_h2(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_h2)
# === html_h2 ========================================================================= #.
-
#html_h3(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
(also: #oop_h3)
# === html_h3 ========================================================================= #.
-
#html_h4(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
(also: #oop_h4)
# === html_h4 ========================================================================= #.
-
#html_h5(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
(also: #oop_h5)
# === html_h5 ========================================================================= #.
-
#html_h6(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_h6)
# === html_h6 ========================================================================= #.
-
#html_head(i = ARGV) ⇒ Object
(also: #oop_head)
# === html_head.
-
#html_img(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #html_image, #oop_image, #oop_img)
# === html_img ========================================================================= #.
-
#html_input(use_this_text = ARGV, optional_css_class = Input.css_class?, optional_id = nil, optional_css_style = nil) ⇒ Object
(also: #entry, #oop_input, #oop_entry)
-
#html_meta(i = ARGV) ⇒ Object
(also: #oop_meta)
-
#html_object(i = ARGV) ⇒ Object
(also: #oop_object)
# === html_object ========================================================================= #.
-
#html_p(i = ARGV, optional_css_class = '') ⇒ Object
(also: #oop_p)
# === html_p ========================================================================= #.
-
#html_pre(i = ARGV) ⇒ Object
(also: #oop_pre)
# === html_pre ========================================================================= #.
-
#html_span(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
(also: #oop_span)
# === html_span ========================================================================= #.
-
#html_style(i = '') ⇒ Object
(also: #oop_style)
# === html_style ========================================================================= #.
-
#html_submit(i = ARGV) ⇒ Object
(also: #html_submit_button, #submit_button, #oop_submit)
# === html_submit ========================================================================= #.
-
#html_table(i = ARGV) ⇒ Object
(also: #oop_table)
# === html_table ========================================================================= #.
-
#html_title(i = ARGV) ⇒ Object
(also: #oop_title)
# === html_title ========================================================================= #.
-
#html_ul(i = ARGV) ⇒ Object
(also: #oop_ul)
# === html_ul ========================================================================= #.
-
#last_tag? ⇒ Boolean
(also: #last_tag)
# === last_tag? ========================================================================= #.
-
#last_tags? ⇒ Boolean
(also: #last_tags)
Class Method Details
#
This method will alias methods such as “h1” towards “oop_h1”. The idea here is that we can simply make use of h1, h2 and so forth tags directly, and point them towards the corresponding oop_ method.
The method used to be a small module, achieving compatibility towards HTML tags, but in July 2023 it was integrated into this module instead, and made a method.
#
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 452
def self.alias_towards_the_registered_html_tags
require 'html_tags/array_registered_html_tags.rb'
::HtmlTags::ARRAY_REGISTERED_HTML_TAGS.each {|this_html_tag|
target_this_method = ('oop_'+this_html_tag).to_sym
if Cyberweb::Objectified::ShorterHelperMethods.respond_to?(target_this_method)
self.class_eval {
alias_method(this_html_tag.to_sym, target_this_method)
}
else
end
}
end
|
Instance Method Details
#html_a(i = ARGV) ⇒ Object
Also known as:
oop_a
228
229
230
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 228
def html_a(i = ARGV)
return Cyberweb::Objectified::HtmlTags::A.new(i)
end
|
#html_abbr(i = ARGV) ⇒ Object
Also known as:
oop_abbr
242
243
244
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 242
def html_abbr(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Abbr.new(i)
end
|
#html_audio(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_audio
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 209
def html_audio(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::Audio.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_blockquote(i = ARGV) ⇒ Object
Also known as:
oop_blockquote
#html_body(i = '') ⇒ Object
Also known as:
oop_body
#
Usage example:
button1 = oop_button('Click me', id: 'test_button')
#
334
335
336
337
338
339
340
341
342
343
344
345
346
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 334
def html_button(
use_this_text = '',
optional_css_class = Button.css_class?,
optional_id = nil,
optional_css_style = nil
)
return Cyberweb::Objectified::HtmlTags::Button.new(
use_this_text,
optional_css_class,
optional_id,
optional_css_style
)
end
|
#html_canvas(i = ARGV) ⇒ Object
Also known as:
oop_canvas
#html_checkbox(i = ARGV) ⇒ Object
385
386
387
388
389
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 385
def html_checkbox(i = ARGV)
_ = Cyberweb::Objectified::HtmlTags::Input.new(i)
_.is_a_checkbox return _
end
|
#html_cite(i = '') ⇒ Object
Also known as:
oop_cite
273
274
275
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 273
def html_cite(i = '')
return Cyberweb::Objectified::HtmlTags::Cite.new(i)
end
|
#html_combobox(i = ARGV) ⇒ Object
Also known as:
html_dropbox, oop_combobox
#
html_combobox
You can pass an Array of options to the method.
#
360
361
362
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 360
def html_combobox(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Combobox.new(i)
end
|
#html_div(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_div
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 406
def html_div(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::Div.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_embed(i = ARGV) ⇒ Object
Also known as:
oop_embed
294
295
296
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 294
def html_embed(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Embed.new(i)
end
|
#html_fieldset(i = '') ⇒ Object
Also known as:
oop_fieldset
256
257
258
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 256
def html_form(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Form.new(i)
end
|
#html_h1(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_h1
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 101
def html_h1(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::H1.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_h2(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_h2
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 120
def html_h2(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::H2.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_h3(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
Also known as:
oop_h3
139
140
141
142
143
144
145
146
147
148
149
150
151
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 139
def html_h3(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil
)
return Cyberweb::Objectified::HtmlTags::H3.new(
i,
optional_css_class,
optional_id,
optional_css_style
)
end
|
#html_h4(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
Also known as:
oop_h4
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 156
def html_h4(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil
)
return Cyberweb::Objectified::HtmlTags::H4.new(
i,
optional_css_class,
optional_id,
optional_css_style
)
end
|
#html_h5(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil) ⇒ Object
Also known as:
oop_h5
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 173
def html_h5(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil
)
return Cyberweb::Objectified::HtmlTags::H5.new(
i,
optional_css_class,
optional_id,
optional_css_style
)
end
|
#html_h6(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_h6
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 190
def html_h6(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::H6.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_head(i = ARGV) ⇒ Object
Also known as:
oop_head
#
html_head
This method will ultimately represent a HTML <head> tag.
#
370
371
372
373
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 370
def html_head(i = ARGV)
i = i.join(' ').strip if i.is_a? Array
return Cyberweb::Objectified::HtmlTags::Head.new(i)
end
|
#html_img(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
html_image, oop_image, oop_img
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 66
def html_img(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::Img.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#
The alias “entry” is derived from GUI toolkits such as gtk calling the user-input element Gtk::Entry.
#
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 32
def html_input(
use_this_text = ARGV,
optional_css_class = Input.css_class?,
optional_id = nil,
optional_css_style = nil
)
_ = Cyberweb::Objectified::HtmlTags::Input.new(
use_this_text,
optional_css_class,
optional_id,
optional_css_style
)
return _
end
|
280
281
282
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 280
def html_meta(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Meta.new(i)
end
|
#html_object(i = ARGV) ⇒ Object
Also known as:
oop_object
#html_p(i = ARGV, optional_css_class = '') ⇒ Object
Also known as:
oop_p
263
264
265
266
267
268
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 263
def html_p(
i = ARGV,
optional_css_class = ''
)
return Cyberweb::Objectified::HtmlTags::P.new(i, optional_css_class)
end
|
#html_pre(i = ARGV) ⇒ Object
Also known as:
oop_pre
308
309
310
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 308
def html_pre(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Pre.new(i)
end
|
#html_span(i = ARGV, optional_css_class = nil, optional_id = nil, optional_css_style = nil, &block) ⇒ Object
Also known as:
oop_span
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 425
def html_span(
i = ARGV,
optional_css_class = nil,
optional_id = nil,
optional_css_style = nil,
&block
)
return Cyberweb::Objectified::HtmlTags::Span.new(
i,
optional_css_class,
optional_id,
optional_css_style,
&block
)
end
|
#html_style(i = '') ⇒ Object
Also known as:
oop_style
#html_submit(i = ARGV) ⇒ Object
Also known as:
html_submit_button, submit_button, oop_submit
395
396
397
398
399
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 395
def html_submit(i = ARGV)
_ = Cyberweb::Objectified::HtmlTags::Input.new(i)
_.is_a_submit_button
return _
end
|
#html_table(i = ARGV) ⇒ Object
Also known as:
oop_table
301
302
303
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 301
def html_table(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Table.new(i)
end
|
#html_title(i = ARGV) ⇒ Object
Also known as:
oop_title
315
316
317
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 315
def html_title(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Title.new(i)
end
|
#html_ul(i = ARGV) ⇒ Object
Also known as:
oop_ul
235
236
237
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 235
def html_ul(i = ARGV)
return Cyberweb::Objectified::HtmlTags::Ul.new(i)
end
|
#last_tag? ⇒ Boolean
Also known as:
last_tag
59
60
61
|
# File 'lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb', line 59
def last_tags?
::Cyberweb::Objectified::HtmlTags.last_tags?
end
|