Class: IbmAppconfigurationRubySdk::Property
- Inherits:
-
Object
- Object
- IbmAppconfigurationRubySdk::Property
- Defined in:
- lib/ibm_appconfiguration_ruby_sdk/models/property.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#property_id ⇒ Object
readonly
Returns the value of attribute property_id.
-
#segment_rules ⇒ Object
readonly
Returns the value of attribute segment_rules.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#data_format ⇒ String?
Get the Property data format applicable only for STRING datatype property.
-
#get_current_value(entity_id, entity_attributes = {}) ⇒ EvaluationResult?
Get the evaluated value of the property.
-
#initialize(property) ⇒ Property
constructor
Initialize a new Property instance.
Constructor Details
#initialize(property) ⇒ Property
Initialize a new Property instance
29 30 31 32 33 34 35 36 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 29 def initialize(property) @name = property[:name] @property_id = property[:property_id] @type = property[:type] @format = property[:format] # will be nil for boolean & numeric datatypes @value = property[:value] @segment_rules = property[:segment_rules] end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def format @format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def name @name end |
#property_id ⇒ Object (readonly)
Returns the value of attribute property_id.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def property_id @property_id end |
#segment_rules ⇒ Object (readonly)
Returns the value of attribute segment_rules.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def segment_rules @segment_rules end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
24 25 26 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 24 def value @value end |
Instance Method Details
#data_format ⇒ String?
Get the Property data format applicable only for STRING datatype property.
43 44 45 46 47 48 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 43 def data_format # Format will be `nil` for Boolean & Numeric properties # If the Format is nil for a String type, we default it to TEXT @format = "TEXT" if @format.nil? && @type == "STRING" @format end |
#get_current_value(entity_id, entity_attributes = {}) ⇒ EvaluationResult?
Get the evaluated value of the property.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/ibm_appconfiguration_ruby_sdk/models/property.rb', line 79 def get_current_value(entity_id, entity_attributes = {}) if entity_id.nil? || entity_id.to_s.strip.empty? logger = Logger.instance logger.error("Property evaluation: #{Constants::INVALID_ENTITY_ID} get_current_value") return nil end require_relative "../configuration_handler" configuration_handler_instance = ConfigurationHandler.current_instance configuration_handler_instance.property_evaluation(self, entity_id, entity_attributes) end |