Class: PuzzlyApiPlugin::Context
- Inherits:
-
Metadata
show all
- Defined in:
- lib/puzzly_api_plugin/metadata/context.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Metadata
#id, #name, #path, #to_identity
Methods inherited from JSONable
#copy_to_hash, #to_s
Constructor Details
#initialize(document, name, description) ⇒ Context
Returns a new instance of Context.
11
12
13
14
15
16
|
# File 'lib/puzzly_api_plugin/metadata/context.rb', line 11
def initialize(document, name, description)
super(document, name)
self[MetadataFields::DESCRIPTION] = description
validate
end
|
Class Method Details
.create(document) ⇒ Object
Instance Method Details
#validate ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/puzzly_api_plugin/metadata/context.rb', line 18
def validate
if(name.nil?)
warn "Please set #{YAMLFields::CONTEXT_NAME} property"
end
if(description.nil?)
warn "Please set #{YAMLFields::CONTEXT_DESCRIPTION} property"
end
end
|