Class: Filter8::Result
- Inherits:
-
Object
- Object
- Filter8::Result
- Defined in:
- lib/filter8/result.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
-
#initialize(json) ⇒ Result
constructor
A new instance of Result.
- #matched? ⇒ Boolean
- #matches ⇒ Object
- #replacement ⇒ Object
Constructor Details
#initialize(json) ⇒ Result
Returns a new instance of Result.
5 6 7 |
# File 'lib/filter8/result.rb', line 5 def initialize(json) @json = json end |
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
3 4 5 |
# File 'lib/filter8/result.rb', line 3 def json @json end |
Instance Method Details
#matched? ⇒ Boolean
13 14 15 |
# File 'lib/filter8/result.rb', line 13 def matched? @json["filter"]["matched"] end |
#matches ⇒ Object
17 18 19 |
# File 'lib/filter8/result.rb', line 17 def matches @json["filter"]["matches"].map { |match| OpenStruct.new(match) } end |
#replacement ⇒ Object
9 10 11 |
# File 'lib/filter8/result.rb', line 9 def replacement @json["filter"]["replacement"] end |