Do anyhow include in the same manner as a constant I have a module? I am currently using is more I can do a bit by using it. or but none of them are ideal Is there. Anyone have a better way? I do not see any reason that it can not be a module rather than a class, because the benefits of creating an object do not exist. The safest thing to do will be to do "hand-by-constants" if you need it If you type in the radius, then the constant will be defined with the correct value: If the number of constants is large, then you can automate the creation a bit . The problem is that it is not everything or nothing, and things like the class name are also stable, so they will also be imported. This is not a problem for the constants looking for you. Hope this helps.
save_options = Nokogiri :: XML :: Node :: SaveOptions :: FORMAT | Nokogiri :: XML :: Node :: SaveOptions :: AS_HTML says html.serialize (: save_with = & gt; save_options)
< Code> Html.serialize (: save_with = & gt; FORMAT | AS_HTML)
nokia: XML includes serialize (serialize: save_with = & gt; node :: save option :: format :: node :: save option :: AS_HTML)
< Code> html.serialize (: Save_with = & gt; Notchory :: XML :: Node :: SaveOnNew format.ASHHML)
class YourClass # or module% Module% w (FORMAT AS_HTML) .each do | Konst Const_set (konst, nokogiri :: XML :: Node :: saveOptions.const_get (konst)) End of End
Category YourClass Nokogiri :: XML :: Node :: saveOptions.constants.each do | Konst
No comments:
Post a Comment