Class: Medusa::Terminology

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject (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

Returns:

  • (Boolean)


46
47
48
# File 'lib/medusa/terminology.rb', line 46

def valid?(action)
  actions.include?(action.to_s)
end

Instance Method Details

#createObject



67
68
69
# File 'lib/medusa/terminology.rb', line 67

def create
  puts 'created!'
end

#deleteObject



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

Returns:

  • (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