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.



14
15
16
17
18
# File 'lib/kameleoon/configuration/variable.rb', line 14

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



8
9
10
# File 'lib/kameleoon/configuration/variable.rb', line 8

def key
  @key
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/kameleoon/configuration/variable.rb', line 8

def type
  @type
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/kameleoon/configuration/variable.rb', line 8

def value
  @value
end

Class Method Details

.create_from_array(array) ⇒ Object



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

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