Sha256: 37af7bc6228e38bee355e997dbe68a351c4e2e2ab2c35bd61c10ac39118a70db

Contents?: true

Size: 592 Bytes

Versions: 71

Compression:

Stored size: 592 Bytes

Contents

class CodeSnippetsHomePresenter
  def code_snippets
    @code_snippets ||= config['code_snippets'].map do |snippet|
      OpenStruct.new(
        html: Nexmo::Markdown::Renderer.new.call(
          <<-STRING
          ```code_snippets
          source: '#{snippet['source']}'
          ```
          STRING
        ),
        title: snippet['title']
      )
    end
  end

  def cache_key
    @cache_key ||= config['code_snippets'].join('-')
  end

  def config
    @config ||= YAML.safe_load(
      File.open("#{Rails.configuration.docs_base_path}/config/business_info.yml")
    )
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
station-0.5.16 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.15 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.14 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.13 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.12 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.11 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.10 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.9 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.8 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.7 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.6 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.5 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.4 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.3 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.2 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.1 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.5.0 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.4.9 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.4.8 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb
station-0.4.7 lib/nexmo_developer/app/presenters/code_snippets_home_presenter.rb