Class: Holodekk::Builder::Instruction

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Validations
Defined in:
lib/holodekk/builder/instruction.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.buildObject

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/holodekk/builder/instruction.rb', line 10

def build
  raise NotImplementedError
end

.instruction_tag(tag) ⇒ Object



14
15
16
# File 'lib/holodekk/builder/instruction.rb', line 14

def instruction_tag(tag)
  @tag = tag
end

.tagObject



18
19
20
# File 'lib/holodekk/builder/instruction.rb', line 18

def tag
  @tag ||= name.demodulize.upcase
end

Instance Method Details

#as_json(options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/holodekk/builder/instruction.rb', line 27

def as_json(options = {})
  raise NotImplementedError
end

#tagObject



23
24
25
# File 'lib/holodekk/builder/instruction.rb', line 23

def tag
  self.class.tag
end

#to_json(*args) ⇒ Object



31
32
33
# File 'lib/holodekk/builder/instruction.rb', line 31

def to_json(*args)
  as_json.to_json(*args)
end