Class: FlameChannelParser::Channel
- Inherits:
-
Object
- Object
- FlameChannelParser::Channel
- 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
-
#base_value ⇒ Object
Returns the value of attribute base_value.
-
#extrapolation ⇒ Object
Returns the value of attribute extrapolation.
-
#name ⇒ Object
Returns the value of attribute name.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#node_type ⇒ Object
readonly
Returns the value of attribute node_type.
Instance Method Summary collapse
-
#initialize(channel_name, node_type, node_name) ⇒ Channel
constructor
A new instance of Channel.
- #inspect ⇒ Object
-
#path ⇒ Object
Returns path to the channel (like axis1/position/x).
-
#to_interpolator ⇒ Object
Get an Interpolator for this channel.
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_value ⇒ Object
Returns the value of attribute base_value.
13 14 15 |
# File 'lib/channel.rb', line 13 def base_value @base_value end |
#extrapolation ⇒ Object
Returns the value of attribute extrapolation.
13 14 15 |
# File 'lib/channel.rb', line 13 def extrapolation @extrapolation end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/channel.rb', line 13 def name @name end |
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
12 13 14 |
# File 'lib/channel.rb', line 12 def node_name @node_name end |
#node_type ⇒ Object (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
#inspect ⇒ Object
32 33 34 |
# File 'lib/channel.rb', line 32 def inspect "<Channel (%s %s) with %d keys>" % [@node_type, path, @keys.size] end |
#path ⇒ Object
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_interpolator ⇒ Object
Get an Interpolator for this channel
28 29 30 |
# File 'lib/channel.rb', line 28 def to_interpolator FlameChannelParser::Interpolator.new(self) end |