Class: Gretel::JSONLD::Breadcrumb::List
- Inherits:
-
Object
- Object
- Gretel::JSONLD::Breadcrumb::List
- Defined in:
- lib/gretel/jsonld/breadcrumb/list.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
NOTE: Override #as_json to cope with Rails 4.0 or former.
-
#initialize(link_collection) ⇒ List
constructor
A new instance of List.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(link_collection) ⇒ List
Returns a new instance of List.
12 13 14 |
# File 'lib/gretel/jsonld/breadcrumb/list.rb', line 12 def initialize(link_collection) @link_collection = link_collection end |
Instance Method Details
#as_json(options = nil) ⇒ Object
NOTE: Override #as_json to cope with Rails 4.0 or former
17 18 19 20 21 22 23 |
# File 'lib/gretel/jsonld/breadcrumb/list.rb', line 17 def as_json( = nil) { "@context": "http://schema.org", "@type": "BreadcrumbList", itemListElement: item_list_element, }.as_json() end |
#to_json(*args) ⇒ Object
25 26 27 |
# File 'lib/gretel/jsonld/breadcrumb/list.rb', line 25 def to_json(*args) as_json.to_json(*args) end |