Class: Talkable::Offer
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Talkable::Offer
- Defined in:
- lib/talkable/resources/offer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.parse(result_hash) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/talkable/resources/offer.rb', line 3 def self.parse(result_hash) return nil unless result_hash && result_hash[:offer] && result_hash[:offer].size > 0 offer = self.new(result_hash[:offer]) offer.claim_links ||= Hashie::Mash.new(result_hash[:claim_links]) offer end |
Instance Method Details
#advocate_share_iframe(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/talkable/resources/offer.rb', line 10 def advocate_share_iframe( = {}) show_trigger = ![:ignore_trigger] = .merge([:iframe] || {}) url = show_trigger ? Furi.merge(show_url, query: {trigger_enabled: 1}) : show_url snippets = [] if ![:iframe] || ![:iframe][:container] snippets << render_container_snipet([:container]) end snippets << render_share_snipet({ url: url, iframe: , }) snippets.join("\n") end |