Class: Medusa::Terminology
- Inherits:
-
Object
- Object
- Medusa::Terminology
- Defined in:
- lib/medusa/terminology.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .[](terminology) ⇒ Object
- .action(action, description) ⇒ Object
- .actions(include_description = false) ⇒ Object
- .valid?(action) ⇒ Boolean
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #dump(file) ⇒ Object
- #exists? ⇒ Boolean
- #export(file, type) ⇒ Object
- #import(file, type) ⇒ Object
-
#initialize(terminology) ⇒ Terminology
constructor
A new instance of Terminology.
Constructor Details
#initialize(terminology) ⇒ Terminology
Returns a new instance of Terminology.
58 59 60 |
# File 'lib/medusa/terminology.rb', line 58 def initialize(terminology) @name = terminology end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
56 57 58 |
# File 'lib/medusa/terminology.rb', line 56 def name @name end |
Class Method Details
.[](terminology) ⇒ Object
50 51 52 |
# File 'lib/medusa/terminology.rb', line 50 def [](terminology) terminology.is_a?(Terminology) ? terminology : new(terminology) end |
.action(action, description) ⇒ Object
41 42 43 |
# File 'lib/medusa/terminology.rb', line 41 def action(action, description) @actions << [action.to_s, description] end |
.actions(include_description = false) ⇒ Object
37 38 39 |
# File 'lib/medusa/terminology.rb', line 37 def actions(include_description = false) include_description ? @actions : @actions.map { |a| a.first } end |
.valid?(action) ⇒ Boolean
46 47 48 |
# File 'lib/medusa/terminology.rb', line 46 def valid?(action) actions.include?(action.to_s) end |
Instance Method Details
#create ⇒ Object
67 68 69 |
# File 'lib/medusa/terminology.rb', line 67 def create puts 'created!' end |
#delete ⇒ Object
72 73 74 |
# File 'lib/medusa/terminology.rb', line 72 def delete puts 'deleted!' end |
#dump(file) ⇒ Object
87 88 89 |
# File 'lib/medusa/terminology.rb', line 87 def dump(file) puts "dumped: #{file}" end |
#exists? ⇒ Boolean
62 63 64 |
# File 'lib/medusa/terminology.rb', line 62 def exists? (rand(10) % 2).zero? # DUMMY! end |
#export(file, type) ⇒ Object
82 83 84 |
# File 'lib/medusa/terminology.rb', line 82 def export(file, type) puts "exported: #{file}, #{type}" end |
#import(file, type) ⇒ Object
77 78 79 |
# File 'lib/medusa/terminology.rb', line 77 def import(file, type) puts "imported: #{file}, #{type}" end |