Class: GoodGuide::Gibbon::Dependency::Query
- Inherits:
-
GoodGuide::Gibbon::Dependency
- Object
- GoodGuide::Gibbon::Dependency
- GoodGuide::Gibbon::Dependency::Query
- Defined in:
- lib/goodguide/gibbon.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#query_type ⇒ Object
readonly
Returns the value of attribute query_type.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(info = {}) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(info = {}) ⇒ Query
Returns a new instance of Query.
377 378 379 380 381 382 383 |
# File 'lib/goodguide/gibbon.rb', line 377 def initialize(info={}) @query_type = info.fetch(:query_type) { raise "no query type" } @annotations = info.fetch(:annotations) { raise "no annotations" } @type = info.fetch(:type) { raise "no type" } @id = info.fetch(:id) { raise "no id" } @value = info.fetch(:value) { raise "no value" } end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
376 377 378 |
# File 'lib/goodguide/gibbon.rb', line 376 def annotations @annotations end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
376 377 378 |
# File 'lib/goodguide/gibbon.rb', line 376 def id @id end |
#query_type ⇒ Object (readonly)
Returns the value of attribute query_type.
376 377 378 |
# File 'lib/goodguide/gibbon.rb', line 376 def query_type @query_type end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
376 377 378 |
# File 'lib/goodguide/gibbon.rb', line 376 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
376 377 378 |
# File 'lib/goodguide/gibbon.rb', line 376 def value @value end |
Instance Method Details
#as_json ⇒ Object
385 386 387 388 389 390 391 392 393 394 |
# File 'lib/goodguide/gibbon.rb', line 385 def as_json { '_tag' => 'query', 'query_type' => query_type, 'annotations' => annotations, 'type' => type, 'id' => id, 'value' => value } end |