Class: Staticky::Generator::ViewContext
- Inherits:
-
Object
- Object
- Staticky::Generator::ViewContext
- Defined in:
- lib/staticky/generator.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#twitter ⇒ Object
readonly
Returns the value of attribute twitter.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url:, title: "", description: "", twitter: "") ⇒ ViewContext
constructor
A new instance of ViewContext.
Constructor Details
#initialize(url:, title: "", description: "", twitter: "") ⇒ ViewContext
Returns a new instance of ViewContext.
10 11 12 13 14 15 16 17 |
# File 'lib/staticky/generator.rb', line 10 def initialize(url:, title: "", description: "", twitter: "") @title = title @description = description @twitter = twitter @url = URI(url) raise ArgumentError, "Must be a full url: #{@url}" unless @url.host end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/staticky/generator.rb', line 8 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/staticky/generator.rb', line 8 def title @title end |
#twitter ⇒ Object (readonly)
Returns the value of attribute twitter.
8 9 10 |
# File 'lib/staticky/generator.rb', line 8 def twitter @twitter end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/staticky/generator.rb', line 8 def url @url end |