nandeck-ruby/lib/nandeck/primitive.rb

35 lines
529 B
Ruby
Raw Permalink Normal View History

2013-10-10 02:51:03 +00:00
module Nandeck
class Primitive
include Conversions
def initializs(card_index)
@card_index = card_index
end
def card_indexes
return @card_indexes if @card_indexes
@card_indexes = []
@card_index.split(',').collect(&:strip).each do |part|
if part['-']
else
@card_indexes << part
end
end
@card_indexes
end
def to_s
raise "Override me"
end
def geometry
"#{@x}, #{@y}, #{@width}, #{@height}"
end
end
end