Class: Apps::Adapters::Gmail::Markup::BaseContext
- Inherits:
-
Base
- Object
- Base
- Apps::Adapters::Gmail::Markup::BaseContext
show all
- Defined in:
- lib/apps/adapters/gmail/markup/base_context.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #to_json, #type
Instance Method Details
#as_json ⇒ Object
8
9
10
|
# File 'lib/apps/adapters/gmail/markup/base_context.rb', line 8
def as_json
{ "@context" => "http://schema.org" }.merge(super)
end
|
#to_script ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/apps/adapters/gmail/markup/base_context.rb', line 12
def to_script
buffer = []
buffer << %{<script type="application/ld+json">}
buffer << to_json(pretty: true)
buffer << %{</script>}
buffer.join("\n")
end
|