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.
415 416 417 418 419 420 421 |
# File 'lib/goodguide/gibbon.rb', line 415 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.
414 415 416 |
# File 'lib/goodguide/gibbon.rb', line 414 def annotations @annotations end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
414 415 416 |
# File 'lib/goodguide/gibbon.rb', line 414 def id @id end |
#query_type ⇒ Object (readonly)
Returns the value of attribute query_type.
414 415 416 |
# File 'lib/goodguide/gibbon.rb', line 414 def query_type @query_type end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
414 415 416 |
# File 'lib/goodguide/gibbon.rb', line 414 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
414 415 416 |
# File 'lib/goodguide/gibbon.rb', line 414 def value @value end |
Instance Method Details
#as_json ⇒ Object
423 424 425 426 427 428 429 430 431 432 |
# File 'lib/goodguide/gibbon.rb', line 423 def as_json { '_tag' => 'query', 'query_type' => query_type, 'annotations' => annotations, 'type' => type, 'id' => id, 'value' => value } end |