Class: Raspar::Result
- Inherits:
-
Object
- Object
- Raspar::Result
- Defined in:
- lib/raspar/result.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #[](f) ⇒ Object
-
#initialize(name, attrs, domain = nil) ⇒ Result
constructor
A new instance of Result.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(name, attrs, domain = nil) ⇒ Result
Returns a new instance of Result.
5 6 7 8 9 |
# File 'lib/raspar/result.rb', line 5 def initialize(name, attrs, domain = nil) @name = name @attrs = attrs @domain = domain if domain end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
15 16 17 |
# File 'lib/raspar/result.rb', line 15 def method_missing(name, *args, &block) @attrs[name] end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
3 4 5 |
# File 'lib/raspar/result.rb', line 3 def attrs @attrs end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
3 4 5 |
# File 'lib/raspar/result.rb', line 3 def domain @domain end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/raspar/result.rb', line 3 def name @name end |
Instance Method Details
#[](f) ⇒ Object
11 12 13 |
# File 'lib/raspar/result.rb', line 11 def [](f) @attrs[f] end |