Class: Oos4ruby::Category
- Inherits:
-
Object
- Object
- Oos4ruby::Category
- Includes:
- Bean
- Defined in:
- lib/oos4ruby/category.rb
Instance Method Summary collapse
-
#initialize(term, scheme = nil) ⇒ Category
constructor
A new instance of Category.
- #to_s ⇒ Object
Methods included from Bean
Constructor Details
#initialize(term, scheme = nil) ⇒ Category
Returns a new instance of Category.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/oos4ruby/category.rb', line 10 def initialize(term, scheme = nil) unless term.instance_of?(REXML::Element) @term = term @scheme = scheme @xml = REXML::Element.new 'category' @xml.add_attributes 'term' => @term, 'scheme' => @scheme else @xml = term end end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/oos4ruby/category.rb', line 21 def to_s return @xml.to_s end |