Class: Charu::Category
- Inherits:
-
Object
- Object
- Charu::Category
- Defined in:
- lib/Charu/ChangeLogMemo.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
Instance Method Summary collapse
- #add(title_source) ⇒ Object
- #get_category_list ⇒ Object
- #get_private_category ⇒ Object
-
#initialize ⇒ Category
constructor
A new instance of Category.
Constructor Details
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
7 8 9 |
# File 'lib/Charu/ChangeLogMemo.rb', line 7 def category @category end |
Instance Method Details
#add(title_source) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/Charu/ChangeLogMemo.rb', line 17 def add(title_source) if title_source == nil then title_source = "" end title_source.scan(/\[(.*?)\]:/).each{|category| @category << category[0] } end |
#get_category_list ⇒ Object
27 28 29 30 |
# File 'lib/Charu/ChangeLogMemo.rb', line 27 def get_category_list() @category.uniq! # 重複削除 return @category end |
#get_private_category ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/Charu/ChangeLogMemo.rb', line 32 def get_private_category() # プライベートの設定 # パブリックのカテゴリーに指定したものだけ、公開することにしてあります。 @category.each{|category| @config.public_category.each{|public_category| if category == public_category then @private_category = true end } } # プライベートの設定 @category.each{|category| @config.private_category.each{|private_category| if category == private_category then @private_category = false end } } return @private_category end |