-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fiat lux, Hapi.HXL _plugins/hapi/hxl.rb!
HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7)
- Loading branch information
Showing
3 changed files
with
119 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# FILUM: _plugins/hapi/hxl.rb | ||
# DESCRIPTIONEM: _[eng] Rudimentar HXL utils for Hapi. [eng]_ | ||
# _[por] Utilitários HXL para Hapi. [por]_ | ||
# | ||
# rubocop:disable RubocopIsRacistAndIcanProveIt/AsciiComments | ||
# @see https://github.com/rubocop/ruby-style-guide/issues/301 | ||
# @see https://github.com/rubocop/ruby-style-guide/issues/137 | ||
# frozen_string_literal: true | ||
|
||
# Trivia: | ||
# - 'HXL' | ||
# - https://hxlstandard.org/ | ||
# - 'obiectum' | ||
# - https://en.wiktionary.org/wiki/obiectum#Latin | ||
# - 'attribūtum' | ||
# - https://en.wiktionary.org/wiki/attributus#Latin | ||
# - contextum | ||
# - https://en.wiktionary.org/wiki/contextus#Latin | ||
# - "referēns" | ||
# - https://en.wiktionary.org/wiki/referens#Latin | ||
# - https://en.wiktionary.org/wiki/reference#English | ||
# - 'capiendum' | ||
# - https://en.wiktionary.org/wiki/capio#Latin | ||
# - 'existendum' | ||
# - https://en.wiktionary.org/wiki/existo#Latin | ||
|
||
module Hapi | ||
# _[eng] Rudimentar HXL utils for Hapi. [eng]_ | ||
# _[por] Utilitários HXL para Hapi. [por]_ | ||
module HXL | ||
module_function | ||
|
||
def hxlattrs_de_linguam(contextum, linguam = nil) | ||
linguam = linguam.nil? ? contextum['page']['linguam'] : linguam | ||
# TODO: _[por] Implementar mensagem de erro se usuário errar linguam | ||
# como usar 'linguam: por' em vez de 'linguam: por-Latn' | ||
# [por]_ | ||
# hxlattrs = contextum['site']['data']['referens']['linguam'][linguam]['hxlattrs'] | ||
# | ||
# hxlattrs | ||
|
||
contextum['site']['data']['referens']['linguam'][linguam]['hxlattrs'] | ||
end | ||
|
||
# TODO: 'quod obiectum attribūtum existendum?' tá mal traduzido | ||
def quod_obiectum_attributum_existendum(obiectum, hxlattrs) | ||
puts hxlattrs | ||
puts obiectum | ||
true | ||
end | ||
|
||
def testum(obiectum, hxlattrs) | ||
|
||
puts 'testum' | ||
puts obiectum | ||
puts hxlattrs | ||
|
||
"TODO #{hxlattrs}" | ||
end | ||
end | ||
end | ||
|
||
# _[por] rubocop é tão racista que obriga re-habilitar | ||
# AsciiComments [por]_ | ||
# rubocop:enable RubocopIsRacistAndIcanProveIt/AsciiComments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters