Class: LaunchDarkly::Impl::Model::Clause Private
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Model::Clause
- Defined in:
- lib/ldclient-rb/impl/model/clause.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #attribute ⇒ LaunchDarkly::Reference readonly private
- #context_kind ⇒ String|nil readonly private
- #data ⇒ Hash readonly private
- #negate ⇒ Boolean readonly private
- #op ⇒ Symbol readonly private
- #values ⇒ Array readonly private
Instance Method Summary collapse
- #as_json ⇒ Object private
-
#initialize(data, errors_out = nil) ⇒ Clause
constructor
private
A new instance of Clause.
Constructor Details
#initialize(data, errors_out = nil) ⇒ Clause
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Clause.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 10 def initialize(data, errors_out = nil) @data = data @context_kind = data[:contextKind] @op = data[:op].to_sym if @op == :segmentMatch @attribute = nil else @attribute = (@context_kind.nil? || @context_kind.empty?) ? Reference.create_literal(data[:attribute]) : Reference.create(data[:attribute]) unless errors_out.nil? || @attribute.error.nil? errors_out << "clause has invalid attribute: #{@attribute.error}" end end @values = data[:values] || [] @negate = !!data[:negate] end |
Instance Attribute Details
#attribute ⇒ LaunchDarkly::Reference (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 31 def attribute @attribute end |
#context_kind ⇒ String|nil (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 29 def context_kind @context_kind end |
#data ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 27 def data @data end |
#negate ⇒ Boolean (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 37 def negate @negate end |
#op ⇒ Symbol (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 33 def op @op end |
#values ⇒ Array (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 35 def values @values end |
Instance Method Details
#as_json ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/ldclient-rb/impl/model/clause.rb', line 39 def as_json @data end |