Class: YJCocoa::Unused
- Defined in:
- lib/yjcocoa/unused/unused.rb
Overview
Usage
Direct Known Subclasses
Constant Summary
Constants inherited from Command
Instance Attribute Summary collapse
-
#ignore ⇒ Object
Returns the value of attribute ignore.
-
#match ⇒ Object
Returns the value of attribute match.
-
#matcho ⇒ Object
property.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #check_ignore(item) ⇒ Object
- #check_match(item) ⇒ Object
-
#initialize(argv) ⇒ Unused
constructor
初始化.
Methods inherited from Command
Constructor Details
#initialize(argv) ⇒ Unused
初始化
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/yjcocoa/unused/unused.rb', line 29 def initialize(argv) super self.matcho = argv.option('match-o') self.match = argv.option('match') self.match = self.match.split(",").reject {|i| i.empty? } if self.match self.ignore = argv.option('ignore') self.ignore = self.ignore.split(",").reject {|i| i.empty? } if self.ignore self.output = argv.option('output') self.output = Dir.pwd + "/YJCocoa.h" unless self.output end |
Instance Attribute Details
#ignore ⇒ Object
Returns the value of attribute ignore.
25 26 27 |
# File 'lib/yjcocoa/unused/unused.rb', line 25 def ignore @ignore end |
#match ⇒ Object
Returns the value of attribute match.
24 25 26 |
# File 'lib/yjcocoa/unused/unused.rb', line 24 def match @match end |
#matcho ⇒ Object
property
23 24 25 |
# File 'lib/yjcocoa/unused/unused.rb', line 23 def matcho @matcho end |
#output ⇒ Object
Returns the value of attribute output.
26 27 28 |
# File 'lib/yjcocoa/unused/unused.rb', line 26 def output @output end |
Instance Method Details
#check_ignore(item) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/yjcocoa/unused/unused.rb', line 48 def check_ignore(item) return false unless self.ignore self.ignore.each { |i| return true if item.include?(i) } return false end |
#check_match(item) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/yjcocoa/unused/unused.rb', line 40 def check_match(item) return true unless self.match self.match.each { |m| return true if item.include?(m) } return false end |