Class: Smplkit::FlagDeclaration

Inherits:
Object
  • Object
show all
Defined in:
lib/smplkit/flags/types.rb

Overview

Describes a flag declaration for buffered registration.

Used by Smplkit::ManagementClient#flags#register to queue declarations for bulk registration. service and environment default to nil; the runtime client fills them from the active Smplkit::Client when it forwards declarations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, type:, default:, service: nil, environment: nil) ⇒ FlagDeclaration

Returns a new instance of FlagDeclaration.



151
152
153
154
155
156
157
158
# File 'lib/smplkit/flags/types.rb', line 151

def initialize(id:, type:, default:, service: nil, environment: nil)
  @id = id
  @type = type
  @default = default
  @service = service
  @environment = environment
  freeze
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



149
150
151
# File 'lib/smplkit/flags/types.rb', line 149

def default
  @default
end

#environmentObject (readonly)

Returns the value of attribute environment.



149
150
151
# File 'lib/smplkit/flags/types.rb', line 149

def environment
  @environment
end

#idObject (readonly)

Returns the value of attribute id.



149
150
151
# File 'lib/smplkit/flags/types.rb', line 149

def id
  @id
end

#serviceObject (readonly)

Returns the value of attribute service.



149
150
151
# File 'lib/smplkit/flags/types.rb', line 149

def service
  @service
end

#typeObject (readonly)

Returns the value of attribute type.



149
150
151
# File 'lib/smplkit/flags/types.rb', line 149

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



160
161
162
163
# File 'lib/smplkit/flags/types.rb', line 160

def ==(other)
  other.is_a?(FlagDeclaration) && id == other.id && type == other.type && default == other.default &&
    service == other.service && environment == other.environment
end

#hashObject



166
# File 'lib/smplkit/flags/types.rb', line 166

def hash = [id, type, default, service, environment].hash