Class: Target

Inherits:
Object
  • Object
show all
Defined in:
lib/ff/ruby/server/sdk/dto/target.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, identifier = name, attributes = {}, is_private = false) ⇒ Target

Returns a new instance of Target.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 5

def initialize(

  name,
  identifier = name,
  attributes = {},
  is_private = false
)

  @name = name
  @identifier = identifier
  @attributes = attributes == nil ? {} : attributes.transform_keys(&:to_sym)
  @is_private = is_private
  @private_attributes = Set[]
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



3
4
5
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 3

def attributes
  @attributes
end

#identifierObject

Returns the value of attribute identifier.



3
4
5
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 3

def identifier
  @identifier
end

#is_privateObject

Returns the value of attribute is_private.



3
4
5
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 3

def is_private
  @is_private
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 3

def name
  @name
end

#private_attributesObject

Returns the value of attribute private_attributes.



3
4
5
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 3

def private_attributes
  @private_attributes
end

Instance Method Details

#is_validObject



20
21
22
23
# File 'lib/ff/ruby/server/sdk/dto/target.rb', line 20

def is_valid

  @identifier != nil && !@identifier.strip.empty?
end