Class: SpotFeel::Dmn::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/spot_feel/dmn/variable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, type_ref:) ⇒ Variable

Returns a new instance of Variable.



12
13
14
15
16
# File 'lib/spot_feel/dmn/variable.rb', line 12

def initialize(id:, name:, type_ref:)
  @id = id
  @name = name
  @type_ref = type_ref
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/spot_feel/dmn/variable.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/spot_feel/dmn/variable.rb', line 6

def name
  @name
end

#type_refObject (readonly)

Returns the value of attribute type_ref.



6
7
8
# File 'lib/spot_feel/dmn/variable.rb', line 6

def type_ref
  @type_ref
end

Class Method Details

.from_json(json) ⇒ Object



8
9
10
# File 'lib/spot_feel/dmn/variable.rb', line 8

def self.from_json(json)
  Variable.new(id: json[:id], name: json[:name], type_ref: json[:type_ref])
end

Instance Method Details

#as_jsonObject



18
19
20
21
22
23
24
# File 'lib/spot_feel/dmn/variable.rb', line 18

def as_json
  {
    id: id,
    name: name,
    type_ref: type_ref,
  }
end