Class: Dingtalk::Robot::Configurable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/dingtalk/robot/configurable.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



36
37
38
# File 'lib/dingtalk/robot/configurable.rb', line 36

def initialize
  self.message_type = :text
end

Instance Attribute Details

#message_typeObject

Returns the value of attribute message_type.



34
35
36
# File 'lib/dingtalk/robot/configurable.rb', line 34

def message_type
  @message_type
end

Instance Method Details

#template_dirObject



52
53
54
# File 'lib/dingtalk/robot/configurable.rb', line 52

def template_dir
  @template_dir.presence || (raise ConfigurationError.new(:template_dir, @template_dir, String))
end

#template_dir=(template_dir) ⇒ Object



48
49
50
# File 'lib/dingtalk/robot/configurable.rb', line 48

def template_dir=(template_dir)
  @template_dir = template_dir.to_s
end

#tokensObject



44
45
46
# File 'lib/dingtalk/robot/configurable.rb', line 44

def tokens
  @tokens.presence || (raise ConfigurationError.new(:tokens, @tokens, Hash))
end

#tokens=(tokens) ⇒ Object



40
41
42
# File 'lib/dingtalk/robot/configurable.rb', line 40

def tokens=(tokens)
  @tokens = tokens.to_h.symbolize_keys!
end