Class: Codeforces::Models::Base
- Inherits:
-
Object
- Object
- Codeforces::Models::Base
- Defined in:
- lib/codeforces/models/base.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #grep(option) ⇒ Object
-
#initialize(new_client, new_base) ⇒ Base
constructor
A new instance of Base.
- #invert_grep(option) ⇒ Object
Constructor Details
#initialize(new_client, new_base) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/codeforces/models/base.rb', line 8 def initialize(new_client, new_base) @client = new_client @base = new_base end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
49 50 51 |
# File 'lib/codeforces/models/base.rb', line 49 def method_missing(method, *args, &block) base.send method, *args, &block end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
6 7 8 |
# File 'lib/codeforces/models/base.rb', line 6 def base @base end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/codeforces/models/base.rb', line 5 def client @client end |
Instance Method Details
#grep(option) ⇒ Object
17 18 19 |
# File 'lib/codeforces/models/base.rb', line 17 def grep(option) chain(base.select {|x| match?(option, x) }) end |
#invert_grep(option) ⇒ Object
13 14 15 |
# File 'lib/codeforces/models/base.rb', line 13 def invert_grep(option) chain(base.select {|x| not_match?(option, x) }) end |