summaryrefslogtreecommitdiff
path: root/lib/dslkeywords/keyword.rb
blob: 59ef5bf4b919af6a31ef1b7830c916092fb0b21e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require_relative '../options'
require_relative '../log'

module RCM
  # The base class of all DSL key words
  class Keyword
    attr_accessor :dsl
    attr_reader :id

    include Options
    include Log

    def self.id_for(name) = "#{to_s.sub('RCM::', '').downcase}('#{name}')"

    def initialize(name) = @id = "#{self.class.to_s.sub('RCM::', '').downcase}('#{name}')"
    def to_s = @id

    class KeywordError < StandardError; end
  end
end