mbrao 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.travis-gemfile +5 -2
  2. data/.travis.yml +2 -2
  3. data/Gemfile +6 -4
  4. data/README.md +1 -0
  5. data/Rakefile +18 -0
  6. data/doc/ActionView/Template/Handlers/MbraoTemplate.html +5 -5
  7. data/doc/ActionView/Template/Handlers.html +5 -5
  8. data/doc/HTML/Pipeline/KramdownFilter.html +5 -5
  9. data/doc/HTML/Pipeline.html +5 -5
  10. data/doc/HTML.html +5 -5
  11. data/doc/Mbrao/Author.html +12 -12
  12. data/doc/Mbrao/Content.html +104 -140
  13. data/doc/Mbrao/ContentPublicInterface.html +6 -6
  14. data/doc/Mbrao/Exceptions/InvalidDate.html +7 -7
  15. data/doc/Mbrao/Exceptions/InvalidMetadata.html +7 -7
  16. data/doc/Mbrao/Exceptions/Parsing.html +7 -7
  17. data/doc/Mbrao/Exceptions/Rendering.html +7 -7
  18. data/doc/Mbrao/Exceptions/UnavailableLocalization.html +7 -7
  19. data/doc/Mbrao/Exceptions/Unimplemented.html +7 -7
  20. data/doc/Mbrao/Exceptions/UnknownEngine.html +7 -7
  21. data/doc/Mbrao/Exceptions.html +5 -5
  22. data/doc/Mbrao/Parser.html +15 -15
  23. data/doc/Mbrao/ParsingEngines/Base.html +5 -5
  24. data/doc/Mbrao/ParsingEngines/PlainText.html +5 -5
  25. data/doc/Mbrao/ParsingEngines.html +5 -5
  26. data/doc/Mbrao/PublicInterface/ClassMethods.html +20 -32
  27. data/doc/Mbrao/PublicInterface.html +5 -5
  28. data/doc/Mbrao/RenderingEngines/Base.html +5 -5
  29. data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +16 -16
  30. data/doc/Mbrao/RenderingEngines.html +5 -5
  31. data/doc/Mbrao/Validations/ClassMethods.html +13 -351
  32. data/doc/Mbrao/Validations.html +5 -5
  33. data/doc/Mbrao/Version.html +7 -7
  34. data/doc/Mbrao.html +5 -5
  35. data/doc/_index.html +6 -6
  36. data/doc/class_list.html +3 -2
  37. data/doc/file.README.html +7 -6
  38. data/doc/file_list.html +2 -1
  39. data/doc/frames.html +1 -1
  40. data/doc/index.html +7 -6
  41. data/doc/js/full_list.js +7 -2
  42. data/doc/method_list.html +67 -192
  43. data/doc/top-level-namespace.html +5 -5
  44. data/lib/mbrao/author.rb +1 -1
  45. data/lib/mbrao/content.rb +10 -12
  46. data/lib/mbrao/exceptions.rb +7 -7
  47. data/lib/mbrao/parser.rb +4 -65
  48. data/lib/mbrao/rendering_engines/html_pipeline.rb +5 -5
  49. data/lib/mbrao/version.rb +2 -2
  50. data/lib/mbrao.rb +1 -1
  51. data/mbrao.gemspec +4 -4
  52. data/spec/coverage_helper.rb +4 -1
  53. data/spec/mbrao/author_spec.rb +5 -5
  54. data/spec/mbrao/content_spec.rb +3 -3
  55. data/spec/mbrao/integrations/rails_spec.rb +8 -8
  56. data/spec/mbrao/parser_spec.rb +19 -96
  57. data/spec/mbrao/parsing_engines/base_spec.rb +7 -7
  58. data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +13 -14
  59. metadata +11 -11
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Class: Mbrao::Content
8
8
 
9
- &mdash; Documentation by YARD 0.8.5.2
9
+ &mdash; Documentation by YARD 0.8.6.2
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -790,9 +790,7 @@
790
790
  294
791
791
  295
792
792
  296
793
- 297
794
- 298
795
- 299</pre>
793
+ 297</pre>
796
794
  </td>
797
795
  <td>
798
796
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -820,16 +818,16 @@
820
818
 
821
819
  <span class='comment'># Sets the `locales` attribute.
822
820
  </span> <span class='comment'>#
823
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
821
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
824
822
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
825
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
823
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
826
824
  <span class='kw'>end</span>
827
825
 
828
826
  <span class='comment'># Sets the `title` attribute.
829
827
  </span> <span class='comment'>#
830
828
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
831
829
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
832
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
830
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
833
831
  <span class='kw'>end</span>
834
832
 
835
833
  <span class='comment'># Sets the `body` attribute.
@@ -844,11 +842,9 @@
844
842
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
845
843
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
846
844
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
847
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
848
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
849
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
845
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
850
846
  <span class='kw'>else</span>
851
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
847
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
852
848
  <span class='kw'>end</span>
853
849
  <span class='kw'>end</span>
854
850
 
@@ -856,7 +852,7 @@
856
852
  </span> <span class='comment'>#
857
853
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
858
854
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
859
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
855
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
860
856
  <span class='kw'>end</span>
861
857
 
862
858
  <span class='comment'># Sets the `author` attribute.
@@ -866,7 +862,7 @@
866
862
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
867
863
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
868
864
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
869
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
865
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
870
866
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
871
867
  <span class='kw'>else</span>
872
868
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -900,7 +896,7 @@
900
896
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
901
897
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
902
898
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
903
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
899
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
904
900
  <span class='kw'>else</span>
905
901
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
906
902
  <span class='kw'>end</span>
@@ -912,7 +908,7 @@
912
908
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
913
909
  </span> <span class='comment'># @return [Array] The validated list of locales.
914
910
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
915
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
911
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
916
912
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
917
913
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
918
914
  <span class='id identifier rubyid_locales'>locales</span>
@@ -1229,9 +1225,7 @@
1229
1225
  294
1230
1226
  295
1231
1227
  296
1232
- 297
1233
- 298
1234
- 299</pre>
1228
+ 297</pre>
1235
1229
  </td>
1236
1230
  <td>
1237
1231
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -1259,16 +1253,16 @@
1259
1253
 
1260
1254
  <span class='comment'># Sets the `locales` attribute.
1261
1255
  </span> <span class='comment'>#
1262
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1256
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
1263
1257
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1264
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1258
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
1265
1259
  <span class='kw'>end</span>
1266
1260
 
1267
1261
  <span class='comment'># Sets the `title` attribute.
1268
1262
  </span> <span class='comment'>#
1269
1263
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1270
1264
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1271
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1265
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1272
1266
  <span class='kw'>end</span>
1273
1267
 
1274
1268
  <span class='comment'># Sets the `body` attribute.
@@ -1283,11 +1277,9 @@
1283
1277
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1284
1278
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1285
1279
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1286
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1287
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1288
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
1280
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1289
1281
  <span class='kw'>else</span>
1290
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
1282
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
1291
1283
  <span class='kw'>end</span>
1292
1284
  <span class='kw'>end</span>
1293
1285
 
@@ -1295,7 +1287,7 @@
1295
1287
  </span> <span class='comment'>#
1296
1288
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1297
1289
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1298
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1290
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1299
1291
  <span class='kw'>end</span>
1300
1292
 
1301
1293
  <span class='comment'># Sets the `author` attribute.
@@ -1305,7 +1297,7 @@
1305
1297
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
1306
1298
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
1307
1299
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1308
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1300
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
1309
1301
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1310
1302
  <span class='kw'>else</span>
1311
1303
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -1339,7 +1331,7 @@
1339
1331
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
1340
1332
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1341
1333
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1342
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1334
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
1343
1335
  <span class='kw'>else</span>
1344
1336
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1345
1337
  <span class='kw'>end</span>
@@ -1351,7 +1343,7 @@
1351
1343
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
1352
1344
  </span> <span class='comment'># @return [Array] The validated list of locales.
1353
1345
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1354
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
1346
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
1355
1347
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
1356
1348
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
1357
1349
  <span class='id identifier rubyid_locales'>locales</span>
@@ -1668,9 +1660,7 @@
1668
1660
  294
1669
1661
  295
1670
1662
  296
1671
- 297
1672
- 298
1673
- 299</pre>
1663
+ 297</pre>
1674
1664
  </td>
1675
1665
  <td>
1676
1666
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -1698,16 +1688,16 @@
1698
1688
 
1699
1689
  <span class='comment'># Sets the `locales` attribute.
1700
1690
  </span> <span class='comment'>#
1701
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1691
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
1702
1692
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1703
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1693
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
1704
1694
  <span class='kw'>end</span>
1705
1695
 
1706
1696
  <span class='comment'># Sets the `title` attribute.
1707
1697
  </span> <span class='comment'>#
1708
1698
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1709
1699
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1710
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1700
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1711
1701
  <span class='kw'>end</span>
1712
1702
 
1713
1703
  <span class='comment'># Sets the `body` attribute.
@@ -1722,11 +1712,9 @@
1722
1712
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1723
1713
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1724
1714
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1725
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1726
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1727
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
1715
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1728
1716
  <span class='kw'>else</span>
1729
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
1717
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
1730
1718
  <span class='kw'>end</span>
1731
1719
  <span class='kw'>end</span>
1732
1720
 
@@ -1734,7 +1722,7 @@
1734
1722
  </span> <span class='comment'>#
1735
1723
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
1736
1724
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1737
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1725
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1738
1726
  <span class='kw'>end</span>
1739
1727
 
1740
1728
  <span class='comment'># Sets the `author` attribute.
@@ -1744,7 +1732,7 @@
1744
1732
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
1745
1733
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
1746
1734
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1747
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1735
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
1748
1736
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1749
1737
  <span class='kw'>else</span>
1750
1738
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -1778,7 +1766,7 @@
1778
1766
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
1779
1767
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1780
1768
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
1781
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
1769
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
1782
1770
  <span class='kw'>else</span>
1783
1771
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1784
1772
  <span class='kw'>end</span>
@@ -1790,7 +1778,7 @@
1790
1778
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
1791
1779
  </span> <span class='comment'># @return [Array] The validated list of locales.
1792
1780
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1793
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
1781
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
1794
1782
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
1795
1783
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
1796
1784
  <span class='id identifier rubyid_locales'>locales</span>
@@ -2107,9 +2095,7 @@
2107
2095
  294
2108
2096
  295
2109
2097
  296
2110
- 297
2111
- 298
2112
- 299</pre>
2098
+ 297</pre>
2113
2099
  </td>
2114
2100
  <td>
2115
2101
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -2137,16 +2123,16 @@
2137
2123
 
2138
2124
  <span class='comment'># Sets the `locales` attribute.
2139
2125
  </span> <span class='comment'>#
2140
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2126
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
2141
2127
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2142
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2128
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
2143
2129
  <span class='kw'>end</span>
2144
2130
 
2145
2131
  <span class='comment'># Sets the `title` attribute.
2146
2132
  </span> <span class='comment'>#
2147
2133
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2148
2134
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2149
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2135
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2150
2136
  <span class='kw'>end</span>
2151
2137
 
2152
2138
  <span class='comment'># Sets the `body` attribute.
@@ -2161,11 +2147,9 @@
2161
2147
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2162
2148
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2163
2149
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2164
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2165
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
2166
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
2150
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
2167
2151
  <span class='kw'>else</span>
2168
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
2152
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
2169
2153
  <span class='kw'>end</span>
2170
2154
  <span class='kw'>end</span>
2171
2155
 
@@ -2173,7 +2157,7 @@
2173
2157
  </span> <span class='comment'>#
2174
2158
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2175
2159
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2176
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2160
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2177
2161
  <span class='kw'>end</span>
2178
2162
 
2179
2163
  <span class='comment'># Sets the `author` attribute.
@@ -2183,7 +2167,7 @@
2183
2167
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
2184
2168
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
2185
2169
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2186
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2170
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
2187
2171
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
2188
2172
  <span class='kw'>else</span>
2189
2173
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -2217,7 +2201,7 @@
2217
2201
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
2218
2202
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2219
2203
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2220
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2204
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
2221
2205
  <span class='kw'>else</span>
2222
2206
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2223
2207
  <span class='kw'>end</span>
@@ -2229,7 +2213,7 @@
2229
2213
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
2230
2214
  </span> <span class='comment'># @return [Array] The validated list of locales.
2231
2215
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2232
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
2216
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
2233
2217
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
2234
2218
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
2235
2219
  <span class='id identifier rubyid_locales'>locales</span>
@@ -2546,9 +2530,7 @@
2546
2530
  294
2547
2531
  295
2548
2532
  296
2549
- 297
2550
- 298
2551
- 299</pre>
2533
+ 297</pre>
2552
2534
  </td>
2553
2535
  <td>
2554
2536
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -2576,16 +2558,16 @@
2576
2558
 
2577
2559
  <span class='comment'># Sets the `locales` attribute.
2578
2560
  </span> <span class='comment'>#
2579
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2561
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
2580
2562
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2581
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2563
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
2582
2564
  <span class='kw'>end</span>
2583
2565
 
2584
2566
  <span class='comment'># Sets the `title` attribute.
2585
2567
  </span> <span class='comment'>#
2586
2568
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2587
2569
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2588
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2570
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2589
2571
  <span class='kw'>end</span>
2590
2572
 
2591
2573
  <span class='comment'># Sets the `body` attribute.
@@ -2600,11 +2582,9 @@
2600
2582
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2601
2583
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2602
2584
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2603
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2604
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
2605
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
2585
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
2606
2586
  <span class='kw'>else</span>
2607
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
2587
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
2608
2588
  <span class='kw'>end</span>
2609
2589
  <span class='kw'>end</span>
2610
2590
 
@@ -2612,7 +2592,7 @@
2612
2592
  </span> <span class='comment'>#
2613
2593
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
2614
2594
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2615
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2595
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
2616
2596
  <span class='kw'>end</span>
2617
2597
 
2618
2598
  <span class='comment'># Sets the `author` attribute.
@@ -2622,7 +2602,7 @@
2622
2602
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
2623
2603
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
2624
2604
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2625
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2605
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
2626
2606
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
2627
2607
  <span class='kw'>else</span>
2628
2608
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -2656,7 +2636,7 @@
2656
2636
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
2657
2637
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2658
2638
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
2659
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2639
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
2660
2640
  <span class='kw'>else</span>
2661
2641
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2662
2642
  <span class='kw'>end</span>
@@ -2668,7 +2648,7 @@
2668
2648
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
2669
2649
  </span> <span class='comment'># @return [Array] The validated list of locales.
2670
2650
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2671
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
2651
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
2672
2652
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
2673
2653
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
2674
2654
  <span class='id identifier rubyid_locales'>locales</span>
@@ -3027,9 +3007,7 @@
3027
3007
  294
3028
3008
  295
3029
3009
  296
3030
- 297
3031
- 298
3032
- 299</pre>
3010
+ 297</pre>
3033
3011
  </td>
3034
3012
  <td>
3035
3013
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -3057,16 +3035,16 @@
3057
3035
 
3058
3036
  <span class='comment'># Sets the `locales` attribute.
3059
3037
  </span> <span class='comment'>#
3060
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3038
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
3061
3039
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3062
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3040
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
3063
3041
  <span class='kw'>end</span>
3064
3042
 
3065
3043
  <span class='comment'># Sets the `title` attribute.
3066
3044
  </span> <span class='comment'>#
3067
3045
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3068
3046
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3069
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3047
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3070
3048
  <span class='kw'>end</span>
3071
3049
 
3072
3050
  <span class='comment'># Sets the `body` attribute.
@@ -3081,11 +3059,9 @@
3081
3059
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3082
3060
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3083
3061
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3084
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3085
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3086
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
3062
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3087
3063
  <span class='kw'>else</span>
3088
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
3064
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
3089
3065
  <span class='kw'>end</span>
3090
3066
  <span class='kw'>end</span>
3091
3067
 
@@ -3093,7 +3069,7 @@
3093
3069
  </span> <span class='comment'>#
3094
3070
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3095
3071
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3096
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3072
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3097
3073
  <span class='kw'>end</span>
3098
3074
 
3099
3075
  <span class='comment'># Sets the `author` attribute.
@@ -3103,7 +3079,7 @@
3103
3079
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
3104
3080
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
3105
3081
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3106
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3082
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
3107
3083
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
3108
3084
  <span class='kw'>else</span>
3109
3085
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -3137,7 +3113,7 @@
3137
3113
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
3138
3114
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3139
3115
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3140
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3116
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
3141
3117
  <span class='kw'>else</span>
3142
3118
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
3143
3119
  <span class='kw'>end</span>
@@ -3149,7 +3125,7 @@
3149
3125
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
3150
3126
  </span> <span class='comment'># @return [Array] The validated list of locales.
3151
3127
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3152
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
3128
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
3153
3129
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
3154
3130
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
3155
3131
  <span class='id identifier rubyid_locales'>locales</span>
@@ -3466,9 +3442,7 @@
3466
3442
  294
3467
3443
  295
3468
3444
  296
3469
- 297
3470
- 298
3471
- 299</pre>
3445
+ 297</pre>
3472
3446
  </td>
3473
3447
  <td>
3474
3448
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -3496,16 +3470,16 @@
3496
3470
 
3497
3471
  <span class='comment'># Sets the `locales` attribute.
3498
3472
  </span> <span class='comment'>#
3499
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3473
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
3500
3474
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3501
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3475
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
3502
3476
  <span class='kw'>end</span>
3503
3477
 
3504
3478
  <span class='comment'># Sets the `title` attribute.
3505
3479
  </span> <span class='comment'>#
3506
3480
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3507
3481
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3508
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3482
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3509
3483
  <span class='kw'>end</span>
3510
3484
 
3511
3485
  <span class='comment'># Sets the `body` attribute.
@@ -3520,11 +3494,9 @@
3520
3494
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3521
3495
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3522
3496
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3523
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3524
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3525
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
3497
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3526
3498
  <span class='kw'>else</span>
3527
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
3499
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
3528
3500
  <span class='kw'>end</span>
3529
3501
  <span class='kw'>end</span>
3530
3502
 
@@ -3532,7 +3504,7 @@
3532
3504
  </span> <span class='comment'>#
3533
3505
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3534
3506
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3535
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3507
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3536
3508
  <span class='kw'>end</span>
3537
3509
 
3538
3510
  <span class='comment'># Sets the `author` attribute.
@@ -3542,7 +3514,7 @@
3542
3514
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
3543
3515
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
3544
3516
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3545
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3517
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
3546
3518
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
3547
3519
  <span class='kw'>else</span>
3548
3520
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -3576,7 +3548,7 @@
3576
3548
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
3577
3549
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3578
3550
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3579
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3551
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
3580
3552
  <span class='kw'>else</span>
3581
3553
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
3582
3554
  <span class='kw'>end</span>
@@ -3588,7 +3560,7 @@
3588
3560
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
3589
3561
  </span> <span class='comment'># @return [Array] The validated list of locales.
3590
3562
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3591
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
3563
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
3592
3564
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
3593
3565
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
3594
3566
  <span class='id identifier rubyid_locales'>locales</span>
@@ -3905,9 +3877,7 @@
3905
3877
  294
3906
3878
  295
3907
3879
  296
3908
- 297
3909
- 298
3910
- 299</pre>
3880
+ 297</pre>
3911
3881
  </td>
3912
3882
  <td>
3913
3883
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -3935,16 +3905,16 @@
3935
3905
 
3936
3906
  <span class='comment'># Sets the `locales` attribute.
3937
3907
  </span> <span class='comment'>#
3938
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3908
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
3939
3909
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3940
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3910
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
3941
3911
  <span class='kw'>end</span>
3942
3912
 
3943
3913
  <span class='comment'># Sets the `title` attribute.
3944
3914
  </span> <span class='comment'>#
3945
3915
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3946
3916
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3947
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3917
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3948
3918
  <span class='kw'>end</span>
3949
3919
 
3950
3920
  <span class='comment'># Sets the `body` attribute.
@@ -3959,11 +3929,9 @@
3959
3929
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3960
3930
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3961
3931
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3962
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3963
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3964
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
3932
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
3965
3933
  <span class='kw'>else</span>
3966
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
3934
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
3967
3935
  <span class='kw'>end</span>
3968
3936
  <span class='kw'>end</span>
3969
3937
 
@@ -3971,7 +3939,7 @@
3971
3939
  </span> <span class='comment'>#
3972
3940
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
3973
3941
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3974
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3942
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
3975
3943
  <span class='kw'>end</span>
3976
3944
 
3977
3945
  <span class='comment'># Sets the `author` attribute.
@@ -3981,7 +3949,7 @@
3981
3949
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
3982
3950
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
3983
3951
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
3984
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3952
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
3985
3953
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
3986
3954
  <span class='kw'>else</span>
3987
3955
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -4015,7 +3983,7 @@
4015
3983
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
4016
3984
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4017
3985
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
4018
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
3986
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
4019
3987
  <span class='kw'>else</span>
4020
3988
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
4021
3989
  <span class='kw'>end</span>
@@ -4027,7 +3995,7 @@
4027
3995
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
4028
3996
  </span> <span class='comment'># @return [Array] The validated list of locales.
4029
3997
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
4030
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
3998
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
4031
3999
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4032
4000
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4033
4001
  <span class='id identifier rubyid_locales'>locales</span>
@@ -4344,9 +4312,7 @@
4344
4312
  294
4345
4313
  295
4346
4314
  296
4347
- 297
4348
- 298
4349
- 299</pre>
4315
+ 297</pre>
4350
4316
  </td>
4351
4317
  <td>
4352
4318
  <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 107</span>
@@ -4374,16 +4340,16 @@
4374
4340
 
4375
4341
  <span class='comment'># Sets the `locales` attribute.
4376
4342
  </span> <span class='comment'>#
4377
- </span> <span class='comment'># @param value [Array] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
4343
+ </span> <span class='comment'># @param value [Array] The new value for the attribute. A empty or &quot;*&quot; will be the default value.
4378
4344
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_locales='>locales=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4379
- <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4345
+ <span class='ivar'>@locales</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
4380
4346
  <span class='kw'>end</span>
4381
4347
 
4382
4348
  <span class='comment'># Sets the `title` attribute.
4383
4349
  </span> <span class='comment'>#
4384
4350
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
4385
4351
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_title='>title=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4386
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
4352
+ <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
4387
4353
  <span class='kw'>end</span>
4388
4354
 
4389
4355
  <span class='comment'># Sets the `body` attribute.
@@ -4398,11 +4364,9 @@
4398
4364
  </span> <span class='comment'># @param value [Array|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
4399
4365
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_tags='>tags=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4400
4366
  <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
4401
- <span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4402
- <span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
4403
- <span class='ivar'>@tags</span> <span class='op'>=</span> <span class='id identifier rubyid_values'>values</span>
4367
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
4404
4368
  <span class='kw'>else</span>
4405
- <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
4369
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span>
4406
4370
  <span class='kw'>end</span>
4407
4371
  <span class='kw'>end</span>
4408
4372
 
@@ -4410,7 +4374,7 @@
4410
4374
  </span> <span class='comment'>#
4411
4375
  </span> <span class='comment'># @param value [String|Hash] The new value for the attribute. If an Hash, keys must be a string with one or locale separated by commas. A empty or &quot;*&quot; will be the default value.
4412
4376
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_more='>more=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4413
- <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
4377
+ <span class='ivar'>@more</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:ensure_string</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
4414
4378
  <span class='kw'>end</span>
4415
4379
 
4416
4380
  <span class='comment'># Sets the `author` attribute.
@@ -4420,7 +4384,7 @@
4420
4384
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='rparen'>)</span> <span class='kw'>then</span>
4421
4385
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
4422
4386
  <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
4423
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
4387
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
4424
4388
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>website</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>image</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>metadata</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>uid</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
4425
4389
  <span class='kw'>else</span>
4426
4390
  <span class='ivar'>@author</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Author</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rparen'>)</span>
@@ -4454,7 +4418,7 @@
4454
4418
  </span> <span class='comment'># @param value [Hash] The new value for the attribute.
4455
4419
  </span> <span class='kw'>def</span> <span class='id identifier rubyid_metadata='>metadata=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4456
4420
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
4457
- <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
4421
+ <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_ensure_hash'>ensure_hash</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span>
4458
4422
  <span class='kw'>else</span>
4459
4423
  <span class='ivar'>@metadata</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='label'>raw:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='rparen'>)</span>
4460
4424
  <span class='kw'>end</span>
@@ -4466,7 +4430,7 @@
4466
4430
  </span> <span class='comment'># @param content [Content|nil] An optional content to check for availability
4467
4431
  </span> <span class='comment'># @return [Array] The validated list of locales.
4468
4432
  </span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
4469
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
4433
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
4470
4434
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4471
4435
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4472
4436
  <span class='id identifier rubyid_locales'>locales</span>
@@ -4632,15 +4596,15 @@
4632
4596
  <pre class="lines">
4633
4597
 
4634
4598
 
4599
+ 231
4600
+ 232
4635
4601
  233
4636
4602
  234
4637
4603
  235
4638
- 236
4639
- 237
4640
- 238</pre>
4604
+ 236</pre>
4641
4605
  </td>
4642
4606
  <td>
4643
- <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 233</span>
4607
+ <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 231</span>
4644
4608
 
4645
4609
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_metadata'>metadata</span><span class='comma'>,</span> <span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
4646
4610
  <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Content</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
@@ -4744,18 +4708,18 @@
4744
4708
  <pre class="lines">
4745
4709
 
4746
4710
 
4711
+ 219
4712
+ 220
4747
4713
  221
4748
4714
  222
4749
4715
  223
4750
- 224
4751
- 225
4752
- 226</pre>
4716
+ 224</pre>
4753
4717
  </td>
4754
4718
  <td>
4755
- <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 221</span>
4719
+ <pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 219</span>
4756
4720
 
4757
4721
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
4758
- <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:strip</span><span class='rparen'>)</span>
4722
+ <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span>
4759
4723
  <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_locale'>locale</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4760
4724
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>UnavailableLocalization</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>if</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
4761
4725
  <span class='id identifier rubyid_locales'>locales</span>
@@ -4770,9 +4734,9 @@
4770
4734
  </div>
4771
4735
 
4772
4736
  <div id="footer">
4773
- Generated on Sat Apr 13 15:59:18 2013 by
4737
+ Generated on Sat Jul 20 16:09:46 2013 by
4774
4738
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
4775
- 0.8.5.2 (ruby-1.9.3).
4739
+ 0.8.6.2 (ruby-1.9.3).
4776
4740
  </div>
4777
4741
 
4778
4742
  </body>