Class: AnimateIt::Chapter

Inherits:
Data
  • Object
show all
Defined in:
lib/animate_it/chapters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#beat_nameObject (readonly)

Returns the value of attribute beat_name

Returns:

  • (Object)

    the current value of beat_name



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def beat_name
  @beat_name
end

#duration_framesObject (readonly)

Returns the value of attribute duration_frames

Returns:

  • (Object)

    the current value of duration_frames



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def duration_frames
  @duration_frames
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def label
  @label
end

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def 
  @metadata
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def name
  @name
end

#start_frameObject (readonly)

Returns the value of attribute start_frame

Returns:

  • (Object)

    the current value of start_frame



4
5
6
# File 'lib/animate_it/chapters.rb', line 4

def start_frame
  @start_frame
end

Instance Method Details

#as_jsonObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/animate_it/chapters.rb', line 9

def as_json(*)
  {
    "name" => name.to_s,
    "label" => label,
    "beat" => beat_name.to_s,
    "startFrame" => start_frame,
    "durationFrames" => duration_frames,
    "endFrame" => end_frame,
    "metadata" => 
  }
end

#end_frameObject



5
6
7
# File 'lib/animate_it/chapters.rb', line 5

def end_frame
  start_frame + duration_frames
end