--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Encode codepoints into their corresponding entities. Various operations are possible, and may be specified in order:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: ":basic :"
    body: Convert the five XML entities ('&quot;&lt;&gt;&amp;)
  - !ruby/struct:SM::Flow::LI 
    label: ":named :"
    body: Convert non-ASCII characters to their named HTML 4.01 equivalent
  - !ruby/struct:SM::Flow::LI 
    label: ":decimal :"
    body: Convert non-ASCII characters to decimal entities (e.g. &amp;#1234;)
  - !ruby/struct:SM::Flow::LI 
    label: ":hexadecimal :"
    body: "Convert non-ASCII characters to hexadecimal entities (e.g. # &amp;#x12ab;)"
  type: :NOTE
- !ruby/struct:SM::Flow::P 
  body: You can specify the commands in any order, but they will be executed in the order listed above to ensure that entity ampersands are not clobbered and that named entities are replaced before numeric ones.
- !ruby/struct:SM::Flow::P 
  body: If no instructions are specified, :basic will be used.
- !ruby/struct:SM::Flow::P 
  body: "Examples:"
- !ruby/struct:SM::Flow::VERB 
  body: "  encode_entities(str) - XML-safe\n  encode_entities(str, :basic, :decimal) - XML-safe and 7-bit clean\n  encode_entities(str, :basic, :named, :decimal) - 7-bit clean, with all\n  non-ASCII characters replaced with their named entity where possible, and\n  decimal equivalents otherwise.\n"
- !ruby/struct:SM::Flow::P 
  body: "Note: It is the program's responsibility to ensure that the source contains valid UTF-8 before calling this method."
full_name: HTMLEntities#encode
is_singleton: false
name: encode
params: (source, *instructions)
visibility: public
