Sha256: 8e8ce2ef43a8962eb327e92d119b0ca63268f176d1d294a93eaab0cc42533a36

Contents?: true

Size: 391 Bytes

Versions: 5

Compression:

Stored size: 391 Bytes

Contents

# frozen_string_literal: true
module SocialNetworking
  # Allows for shareable items to be passed in to evaluate properties
  class Shareable
    def initialize(item = nil)
      @item = item
    end

    def action
      @item.try(:action) || "Shared"
    end

    def description
      @item.try(:shared_description) ||
        "Description not available for this item."
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
social_networking-0.13.3 app/models/social_networking/shareable.rb
social_networking-0.13.2 app/models/social_networking/shareable.rb
social_networking-0.13.1 app/models/social_networking/shareable.rb
social_networking-0.13.0 app/models/social_networking/shareable.rb
social_networking-0.12.0 app/models/social_networking/shareable.rb