Class: OpenGraphy::MetaTag
- Inherits:
-
Object
- Object
- OpenGraphy::MetaTag
- Defined in:
- lib/open_graphy/meta_tag.rb
Instance Method Summary collapse
-
#initialize(doc, meta_tag) ⇒ MetaTag
constructor
A new instance of MetaTag.
- #name ⇒ Object
- #namespace ⇒ Object
- #valid? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(doc, meta_tag) ⇒ MetaTag
Returns a new instance of MetaTag.
3 4 5 |
# File 'lib/open_graphy/meta_tag.rb', line 3 def initialize(doc, ) @doc, @meta_tag = doc, end |
Instance Method Details
#name ⇒ Object
15 16 17 |
# File 'lib/open_graphy/meta_tag.rb', line 15 def name @meta_tag.attr('property').sub(tag_name, '') end |
#namespace ⇒ Object
7 8 9 |
# File 'lib/open_graphy/meta_tag.rb', line 7 def namespace @namespace ||= TagNamespace.new(tag_name.split(':')) end |
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/open_graphy/meta_tag.rb', line 11 def valid? tag_name end |
#value ⇒ Object
19 20 21 |
# File 'lib/open_graphy/meta_tag.rb', line 19 def value @meta_tag.attr('content').to_s end |