Class: JsonRuleObjectKey

Inherits:
Object
  • Object
show all
Defined in:
lib/jsondef.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ JsonRuleObjectKey

Returns a new instance of JsonRuleObjectKey.



106
107
108
109
110
# File 'lib/jsondef.rb', line 106

def initialize(key)
  @key = key
  @required = true
  @value = :wildcard
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



104
105
106
# File 'lib/jsondef.rb', line 104

def key
  @key
end

#requiredObject (readonly)

Returns the value of attribute required.



104
105
106
# File 'lib/jsondef.rb', line 104

def required
  @required
end

#valueObject (readonly)

Returns the value of attribute value.



104
105
106
# File 'lib/jsondef.rb', line 104

def value
  @value
end

Instance Method Details

#set_optionalObject



112
113
114
115
# File 'lib/jsondef.rb', line 112

def set_optional()
  @required = false
  self
end

#set_value_rule(rule) ⇒ Object



122
123
124
125
# File 'lib/jsondef.rb', line 122

def set_value_rule(rule)
  @value = rule
  self
end

#set_value_type(type) ⇒ Object



117
118
119
120
# File 'lib/jsondef.rb', line 117

def set_value_type(type)
  @value = type
  self
end