Class: WeatherForecasts::Client::QueryProperty
- Inherits:
-
Object
- Object
- WeatherForecasts::Client::QueryProperty
- Defined in:
- lib/weather_forecasts/client/query/query_property.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#required ⇒ Object
Returns the value of attribute required.
-
#required_keys ⇒ Object
Returns the value of attribute required_keys.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attr, parameters = {}) ⇒ QueryProperty
constructor
A new instance of QueryProperty.
- #valid?(conditions) ⇒ Boolean
Constructor Details
#initialize(attr, parameters = {}) ⇒ QueryProperty
Returns a new instance of QueryProperty.
6 7 8 9 10 11 12 13 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 6 def initialize(attr, parameters = {}) @name = attr @default = parameters[:default] @options = parameters[:options] @type = parameters[:type] || String @required = parameters[:required] || false @required_keys = parameters[:required_keys] || [] end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def @options end |
#required ⇒ Object
Returns the value of attribute required.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def required @required end |
#required_keys ⇒ Object
Returns the value of attribute required_keys.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def required_keys @required_keys end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 4 def type @type end |
Instance Method Details
#valid?(conditions) ⇒ Boolean
15 16 17 18 19 20 21 22 |
# File 'lib/weather_forecasts/client/query/query_property.rb', line 15 def valid?(conditions) @conditions = conditions validate_required validate_type validate_required_keys end |