Class: Hatenablog::Category
- Inherits:
-
Object
- Object
- Hatenablog::Category
- Defined in:
- lib/hatenablog/category.rb
Class Method Summary collapse
-
.load_xml(xml) ⇒ Hatenablog::Category
Create a new blog categories from a XML string.
Instance Method Summary collapse
- #categories ⇒ Array
- #each(&block) ⇒ Object
-
#fixed? ⇒ Boolean
If fixed, only categories in this categories can be used for a blog entry.
Class Method Details
.load_xml(xml) ⇒ Hatenablog::Category
Create a new blog categories from a XML string.
9 10 11 |
# File 'lib/hatenablog/category.rb', line 9 def self.load_xml(xml) Hatenablog::Category.new(xml) end |
Instance Method Details
#categories ⇒ Array
14 15 16 |
# File 'lib/hatenablog/category.rb', line 14 def categories @categories.dup end |
#each(&block) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/hatenablog/category.rb', line 18 def each(&block) return enum_for unless block_given? @categories.each do |category| # @type var block: ^(String) -> void block.call(category) end end |
#fixed? ⇒ Boolean
If fixed, only categories in this categories can be used for a blog entry.
29 30 31 |
# File 'lib/hatenablog/category.rb', line 29 def fixed? @fixed == 'yes' end |