Class: Tudu::Dsl
- Inherits:
-
Object
- Object
- Tudu::Dsl
- Defined in:
- lib/tudu_dsl.rb
Overview
Tudu::Dsl
Constant Summary collapse
- TARGET_TYPES =
TARGET_TYPES
notice target types
types
-
none: no notice
-
mail: mail notice
-
{ none: :none, mail: :mail }
Instance Attribute Summary collapse
-
#_target_type ⇒ Object
notice target type.
-
#_targets ⇒ Object
notice targets.
Instance Method Summary collapse
-
#initialize ⇒ Dsl
constructor
initialize Dsl.
-
#target_type(target_type) ⇒ Object
initialize Dsl === Params - target_type: target notice type.
- #targets(target_type) ⇒ Object
Constructor Details
#initialize ⇒ Dsl
initialize Dsl
19 20 21 22 |
# File 'lib/tudu_dsl.rb', line 19 def initialize @_target_type = TARGET_TYPES[:none] @_targets = [] end |
Instance Attribute Details
#_target_type ⇒ Object
notice target type
14 15 16 |
# File 'lib/tudu_dsl.rb', line 14 def _target_type @_target_type end |
#_targets ⇒ Object
notice targets
16 17 18 |
# File 'lib/tudu_dsl.rb', line 16 def _targets @_targets end |
Instance Method Details
#target_type(target_type) ⇒ Object
initialize Dsl
Params
-
target_type: target notice type
27 28 29 30 31 32 33 |
# File 'lib/tudu_dsl.rb', line 27 def target_type(target_type) return if target_type.nil? return unless [String, Symbol].include?(target_type.class) target_type = target_type.to_sym if target_type.instance_of? String return unless TARGET_TYPES.include? target_type @_target_type = target_type end |
#targets(target_type) ⇒ Object
35 36 37 38 39 |
# File 'lib/tudu_dsl.rb', line 35 def targets(target_type) return if target_type.nil? return unless target_type.instance_of? Array @_targets = target_type end |