Class: SvgDocument::Base

Inherits:
Object show all
Includes:
HasTranslation
Defined in:
lib/gamebox/core/svg_document.rb

Direct Known Subclasses

Group, Path, Rectangle

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasTranslation

#translation

Constructor Details

#initialize(node) ⇒ Base



55
56
57
58
# File 'lib/gamebox/core/svg_document.rb', line 55

def initialize(node)
  raise "Can't make #{self.class.name} from nil" if node.nil?
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node



53
54
55
# File 'lib/gamebox/core/svg_document.rb', line 53

def node
  @node
end

Instance Method Details

#game_classObject



60
61
62
# File 'lib/gamebox/core/svg_document.rb', line 60

def game_class
  @node.attributes['game:class']
end

#game_handleObject



64
65
66
# File 'lib/gamebox/core/svg_document.rb', line 64

def game_handle
  @node.attributes['game:handle']
end

#visible?Boolean



68
69
70
# File 'lib/gamebox/core/svg_document.rb', line 68

def visible?
  @node.attributes['visible'] != 'false'
end