Class: Aun::Finder
- Inherits:
-
Object
- Object
- Aun::Finder
- Defined in:
- lib/aun/finder.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #add_messages(messages = []) ⇒ Object
- #aun_definitions(origin_filter = '') ⇒ Object
-
#initialize ⇒ Finder
constructor
A new instance of Finder.
- #inspect_all(origin_filter = '') ⇒ Object
Constructor Details
#initialize ⇒ Finder
Returns a new instance of Finder.
7 8 9 |
# File 'lib/aun/finder.rb', line 7 def initialize @messages = Aun::DefaultMessages::MESSAGES end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
6 7 8 |
# File 'lib/aun/finder.rb', line 6 def @messages end |
Instance Method Details
#add_messages(messages = []) ⇒ Object
38 39 40 |
# File 'lib/aun/finder.rb', line 38 def ( = []) @messages += end |
#aun_definitions(origin_filter = '') ⇒ Object
33 34 35 36 |
# File 'lib/aun/finder.rb', line 33 def aun_definitions(origin_filter = '') return @messages if origin_filter.empty? @messages.select { |e|e.origin == origin_filter } end |
#inspect_all(origin_filter = '') ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/aun/finder.rb', line 24 def inspect_all(origin_filter = '') if origin_filter && origin_filter.empty? @messages.map(&:inspect).join("\n") else @messages.select { |e|e.origin == origin_filter } .map(&:inspect).join("\n") end end |