Module: ActiveFacts::API::Value

Includes:
Instance
Defined in:
lib/activefacts/api/value.rb

Overview

All Value instances include the methods defined here

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes included from Instance

#constellation

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Instance

#retract

Class Method Details

.included(other) ⇒ Object

:nodoc:



120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/activefacts/api/value.rb', line 120

def self.included other #:nodoc:
  other.send :extend, ClassMethods

  #puts "ValueType included in #{other.basename} from #{caller*"\n\t"}"

  # Register ourselves with the parent module, which has become a Vocabulary:
  vocabulary = other.modspace
  # puts "ValueType.included(#{other.inspect})"
  unless vocabulary.respond_to? :concept  # Extend module with Vocabulary if necessary
    vocabulary.send :extend, Vocabulary
  end
  vocabulary.__add_concept(other)
end

Instance Method Details

#identifying_role_valuesObject

A value is its own key



28
29
30
# File 'lib/activefacts/api/value.rb', line 28

def identifying_role_values #:nodoc:
  self
end

#initialize(*args) ⇒ Object

Value instance methods:



17
18
19
20
# File 'lib/activefacts/api/value.rb', line 17

def initialize(*args) #:nodoc:
  args[0] = args[0].__getobj__ if RoleProxy === args[0]
  super(args)
end

#verbalise(role_name = nil) ⇒ Object

verbalise this Value



23
24
25
# File 'lib/activefacts/api/value.rb', line 23

def verbalise(role_name = nil)
  "#{role_name || self.class.basename} '#{to_s}'"
end