Class: LcpRuby::GroupedQuery::Row
- Inherits:
-
Object
- Object
- LcpRuby::GroupedQuery::Row
- Defined in:
- lib/lcp_ruby/grouped_query/row.rb
Instance Attribute Summary collapse
-
#group_values ⇒ Object
readonly
Returns the value of attribute group_values.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #grouped_row? ⇒ Boolean
- #id ⇒ Object
-
#initialize(values, group_values: {}) ⇒ Row
constructor
A new instance of Row.
- #method_missing(name, *args) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(values, group_values: {}) ⇒ Row
Returns a new instance of Row.
6 7 8 9 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 6 def initialize(values, group_values: {}) @values = values.transform_keys(&:to_s) @group_values = group_values.transform_keys(&:to_s) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 23 def method_missing(name, *args) key = name.to_s return @values[key] if @values.key?(key) super end |
Instance Attribute Details
#group_values ⇒ Object (readonly)
Returns the value of attribute group_values.
4 5 6 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 4 def group_values @group_values end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
4 5 6 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 4 def values @values end |
Instance Method Details
#grouped_row? ⇒ Boolean
11 12 13 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 11 def grouped_row? true end |
#id ⇒ Object
15 16 17 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 15 def id nil end |
#respond_to_missing?(name, include_private = false) ⇒ Boolean
19 20 21 |
# File 'lib/lcp_ruby/grouped_query/row.rb', line 19 def respond_to_missing?(name, include_private = false) @values.key?(name.to_s) || super end |