Class: Broadway::Definition::Link
- Inherits:
-
Object
- Object
- Broadway::Definition::Link
- Defined in:
- lib/broadway/processors/link.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#records ⇒ Object
Returns the value of attribute records.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site, context, &block) ⇒ Link
constructor
A new instance of Link.
- #link(*args, &block) ⇒ Object
Constructor Details
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
4 5 6 |
# File 'lib/broadway/processors/link.rb', line 4 def context @context end |
#records ⇒ Object
Returns the value of attribute records.
4 5 6 |
# File 'lib/broadway/processors/link.rb', line 4 def records @records end |
#site ⇒ Object
Returns the value of attribute site.
4 5 6 |
# File 'lib/broadway/processors/link.rb', line 4 def site @site end |
Instance Method Details
#link(*args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/broadway/processors/link.rb', line 13 def link(*args, &block) = args. href = args.shift title = args.shift || [:title] || href.split("/").last.titleize record = Broadway::Link.new(site, :href => href, :title => title, :categories => [context.to_s]) self.records << record site.links << record if block_given? record.children = Broadway::Definition::Link.new(site, context, &block).records end end |