Sha256: be087494295eea0d749bb893bfa421624b64f9af623411857fe833227f26e33d

Contents?: true

Size: 653 Bytes

Versions: 3

Compression:

Stored size: 653 Bytes

Contents

json.data do
  json.(@song, :identifier, :title, :artist)

  json.sections @song.sections do |section|
    json.(section, :name)

    json.lines section.lines do |line|
      json.array! line do |component|
        case component
        when Songbooks::Components::Literal
          json.component_type 'literal'
          json.content component.to_s
        when Songbooks::Components::Chord
          json.component_type 'chord'
          json.name component.name
          json.transposed_by component.transposed_by.to_s
        else
          json.type 'unknown'
          json.content 'unknown component: '
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
songbooks-0.1.2 app/views/songs/show.jbuilder
songbooks-0.1.1 app/views/songs/show.jbuilder
songbooks-0.1.0 app/views/songs/show.jbuilder