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
#initialize ⇒ Category
Returns a new instance of Category.
6 7 8 9 10 11 12 13 |
# File 'lib/Charu/ChangeLogMemo.rb', line 6 def initialize() @category = [] @config = Charu::Config.new() # プライベートの設定 # 基本は全部プライベート @private_category = false end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
5 6 7 |
# File 'lib/Charu/ChangeLogMemo.rb', line 5 def category @category end |
Instance Method Details
#add(title_source) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/Charu/ChangeLogMemo.rb', line 15 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
25 26 27 28 |
# File 'lib/Charu/ChangeLogMemo.rb', line 25 def get_category_list() @category.uniq! # 重複削除 return @category end |
#get_private_category ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/Charu/ChangeLogMemo.rb', line 30 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 |