Class: FlameChannelParser::Channel

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/channel.rb

Overview

Represents a channel parsed from the Flame setup. Contains the channel metadata and keyframes (Key objects). Supports the following standard Array methods: :empty?, :size, :each, :[], :push

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel_name, node_type, node_name) ⇒ Channel

Returns a new instance of Channel.



17
18
19
20
# File 'lib/channel.rb', line 17

def initialize(channel_name, node_type, node_name)
  @keys = []
  @node_type, @node_name, @name = node_type, node_name, channel_name.strip
end

Instance Attribute Details

#base_valueObject

Returns the value of attribute base_value.



13
14
15
# File 'lib/channel.rb', line 13

def base_value
  @base_value
end

#extrapolationObject

Returns the value of attribute extrapolation.



13
14
15
# File 'lib/channel.rb', line 13

def extrapolation
  @extrapolation
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/channel.rb', line 13

def name
  @name
end

#node_nameObject (readonly)

Returns the value of attribute node_name.



12
13
14
# File 'lib/channel.rb', line 12

def node_name
  @node_name
end

#node_typeObject (readonly)

Returns the value of attribute node_type.



12
13
14
# File 'lib/channel.rb', line 12

def node_type
  @node_type
end

Instance Method Details

#inspectObject



32
33
34
# File 'lib/channel.rb', line 32

def inspect
  "<Channel (%s %s) with %d keys>" % [@node_type, path, @keys.size]
end

#pathObject

Returns path to the channel (like axis1/position/x)



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

def path
  [@node_name, name].compact.join("/")
end

#to_interpolatorObject

Get an Interpolator for this channel



28
29
30
# File 'lib/channel.rb', line 28

def to_interpolator
  FlameChannelParser::Interpolator.new(self)
end