Class: Kameleoon::Configuration::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/configuration/variable.rb

Overview

Variable class contains key / type / value of variable

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Variable

Returns a new instance of Variable.



16
17
18
19
20
# File 'lib/kameleoon/configuration/variable.rb', line 16

def initialize(hash)
  @key = hash['key']
  @type = hash['type']
  @value = hash['value']
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



10
11
12
# File 'lib/kameleoon/configuration/variable.rb', line 10

def key
  @key
end

#typeObject

Returns the value of attribute type.



10
11
12
# File 'lib/kameleoon/configuration/variable.rb', line 10

def type
  @type
end

#valueObject

Returns the value of attribute value.



10
11
12
# File 'lib/kameleoon/configuration/variable.rb', line 10

def value
  @value
end

Class Method Details

.create_from_array(array) ⇒ Object



12
13
14
# File 'lib/kameleoon/configuration/variable.rb', line 12

def self.create_from_array(array)
  array&.map { |it| Variable.new(it) }
end