class Eco::API::Common::Loaders::CaseBase

Attributes

name[W]
type[W]

Public Class Methods

name(value = nil) click to toggle source

The name that this case, policy or error handler will have.

# File lib/eco/api/common/loaders/case_base.rb, line 11
def name(value = nil)
  name_only_once! if value
  set_created_at!
  return @name ||= self.to_s unless value
  @name = value
end
name_only_once!() click to toggle source

Prevent the same class to be re-opened/re-named

# File lib/eco/api/common/loaders/case_base.rb, line 19
def name_only_once!
  raise "You have already declared #{self} or you are trying to give it a name twice" if @name
end

Public Instance Methods

name() click to toggle source
# File lib/eco/api/common/loaders/case_base.rb, line 25
def name
  self.class.name
end