Class: Cassowary::AbstractVariable

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ AbstractVariable

Returns a new instance of AbstractVariable.



7
8
9
# File 'lib/variables/abstract_variable.rb', line 7

def initialize(hash = {})
  self.name = hash[:name]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/variables/abstract_variable.rb', line 5

def name
  @name
end

Instance Method Details

#dummy?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/variables/abstract_variable.rb', line 11

def dummy?
  false
end

#external?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/variables/abstract_variable.rb', line 15

def external?
  raise NotImplementedError, "my subclass should have implemented #external?"
end

#inspectObject



27
28
29
30
31
32
33
# File 'lib/variables/abstract_variable.rb', line 27

def inspect
  if name
    "#{name}"
  else
    "<CV#0x#{object_id.to_s(16)}>"
  end
end

#pivotable?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/variables/abstract_variable.rb', line 19

def pivotable?
  raise NotImplementedError, "my subclass should have implemented #pivotable?"
end

#restricted?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/variables/abstract_variable.rb', line 23

def restricted?
  raise NotImplementedError, "my subclass should have implemented #restricted?"
end