Class: Norikra::SuspendedQuery
- Inherits:
-
Object
- Object
- Norikra::SuspendedQuery
- Defined in:
- lib/norikra/suspended_query.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#group ⇒ Object
Returns the value of attribute group.
-
#name ⇒ Object
Returns the value of attribute name.
-
#targets ⇒ Object
Returns the value of attribute targets.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #create ⇒ Object
-
#initialize(query) ⇒ SuspendedQuery
constructor
A new instance of SuspendedQuery.
- #suspended? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(query) ⇒ SuspendedQuery
Returns a new instance of SuspendedQuery.
8 9 10 11 12 13 |
# File 'lib/norikra/suspended_query.rb', line 8 def initialize(query) @name = query.name @group = query.group @expression = query.expression @targets = query.targets end |
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
6 7 8 |
# File 'lib/norikra/suspended_query.rb', line 6 def expression @expression end |
#group ⇒ Object
Returns the value of attribute group.
6 7 8 |
# File 'lib/norikra/suspended_query.rb', line 6 def group @group end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/norikra/suspended_query.rb', line 6 def name @name end |
#targets ⇒ Object
Returns the value of attribute targets.
6 7 8 |
# File 'lib/norikra/suspended_query.rb', line 6 def targets @targets end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/norikra/suspended_query.rb', line 15 def <=>(other) if @group.nil? || other.group.nil? if @group.nil? && other.group.nil? @name <=> other.name else @group.to_s <=> other.group.to_s end else if @group == other.group self.name <=> other.name else self.group <=> other.group end end end |
#create ⇒ Object
39 40 41 |
# File 'lib/norikra/suspended_query.rb', line 39 def create Query.new(name: @name, group: @group, expression: @expression) end |
#suspended? ⇒ Boolean
31 32 33 |
# File 'lib/norikra/suspended_query.rb', line 31 def suspended? true end |
#to_hash ⇒ Object
35 36 37 |
# File 'lib/norikra/suspended_query.rb', line 35 def to_hash {'name' => @name, 'group' => @group, 'expression' => @expression, 'targets' => @targets, 'suspended' => true} end |