Module: ROXML::ClassMethods::Accessors
- Defined in:
- lib/roxml.rb
Instance Method Summary collapse
-
#roxml_attrs ⇒ Object
Returns array of internal reference objects, such as attributes and composed XML objects.
-
#roxml_namespace ⇒ Object
:nodoc:.
-
#roxml_tag_name ⇒ Object
:nodoc:.
-
#tag_name ⇒ Object
Returns the tag name (also known as xml_name) of the class.
Instance Method Details
#roxml_attrs ⇒ Object
Returns array of internal reference objects, such as attributes and composed XML objects
467 468 469 470 |
# File 'lib/roxml.rb', line 467 def roxml_attrs @roxml_attrs ||= [] (@roxml_attrs + (superclass.respond_to?(:roxml_attrs) ? superclass.roxml_attrs : [])).freeze end |
#roxml_namespace ⇒ Object
:nodoc:
459 460 461 462 463 |
# File 'lib/roxml.rb', line 459 def roxml_namespace # :nodoc: @roxml_namespace || begin superclass.roxml_namespace if superclass.respond_to?(:roxml_namespace) end end |
#roxml_tag_name ⇒ Object
:nodoc:
453 454 455 456 457 |
# File 'lib/roxml.rb', line 453 def roxml_tag_name # :nodoc: @roxml_tag_name || begin superclass.roxml_tag_name if superclass.respond_to?(:roxml_tag_name) end end |
#tag_name ⇒ Object
Returns the tag name (also known as xml_name) of the class. If no tag name is set with xml_name method, returns default class name in lowercase.
If xml_convention is set, it is called with an underscored version of the class name. This is because active support’s inflector generally expects an underscored version, and several operations (e.g. camelcase(:lower), dasherize) do not work without one.
445 446 447 448 449 450 451 |
# File 'lib/roxml.rb', line 445 def tag_name return roxml_tag_name if roxml_tag_name if tag_name = name.split('::').last roxml_naming_convention ? roxml_naming_convention.call(tag_name.underscore) : tag_name.downcase end end |