class Flagger::Entity
Public Class Methods
new(id, **args)
click to toggle source
# File lib/flagger/entity.rb, line 29 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] : nil @group = args.has_key?(:group) ? args[:group] : nil end end
Public Instance Methods
to_json()
click to toggle source
# File lib/flagger/entity.rb, line 39 def to_json { id: @id, name: @name, type: @type, attributes: @attributes, group: @group }.compact.to_json end