Class: FeatureHub::Sdk::ClientEvalFeatureContext

Inherits:
ClientContext show all
Defined in:
lib/feature_hub/sdk/context.rb

Overview

represents the strategies being evaluated locally

Instance Attribute Summary

Attributes inherited from ClientContext

#repo

Instance Method Summary collapse

Methods inherited from ClientContext

#attribute_value, #boolean, #clear, #country, #default_percentage_key, #device, #enabled?, #exists?, #flag, #get_attr, #json, #number, #platform, #raw_json, #session_key, #set?, #string, #user_key, #version

Constructor Details

#initialize(repo, edge) ⇒ ClientEvalFeatureContext

Returns a new instance of ClientEvalFeatureContext.



142
143
144
145
146
# File 'lib/feature_hub/sdk/context.rb', line 142

def initialize(repo, edge)
  super(repo)

  @edge = edge
end

Instance Method Details

#buildObject



148
149
150
151
# File 'lib/feature_hub/sdk/context.rb', line 148

def build
  @edge.poll
  self
end

#build_syncObject



153
154
155
# File 'lib/feature_hub/sdk/context.rb', line 153

def build_sync
  self
end

#feature(key) ⇒ Object



157
158
159
# File 'lib/feature_hub/sdk/context.rb', line 157

def feature(key)
  @repo.feature(key).with_context(self)
end