class Flagger::Group

Public Class Methods

new(id, **args) click to toggle source
# File lib/flagger/entity.rb, line 7
def initialize(id, **args)
  @id = id.to_s
  unless args.empty?
    @type = args.has_key?(:type) ? args[:type].to_s : nil
    @name = args.has_key?(:name) ? args[:name].to_s : nil
    @attributes = args.has_key?(:attributes) ? args[:attributes].to_s : nil
  end

end

Public Instance Methods

to_json() click to toggle source
# File lib/flagger/entity.rb, line 17
def to_json
  {
      id: @id,
      name: @name,
      attributes: @attributes
  }.compact.to_json
end