Class: Refinery::WordPress::Author
- Inherits:
-
Object
- Object
- Refinery::WordPress::Author
- Defined in:
- lib/wordpress/author.rb
Instance Attribute Summary collapse
-
#author_node ⇒ Object
readonly
Returns the value of attribute author_node.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #email ⇒ Object
-
#initialize(author_node) ⇒ Author
constructor
A new instance of Author.
- #inspect ⇒ Object
- #login ⇒ Object
- #to_refinery ⇒ Object
Constructor Details
#initialize(author_node) ⇒ Author
Returns a new instance of Author.
6 7 8 |
# File 'lib/wordpress/author.rb', line 6 def initialize() @author_node = end |
Instance Attribute Details
#author_node ⇒ Object (readonly)
Returns the value of attribute author_node.
4 5 6 |
# File 'lib/wordpress/author.rb', line 4 def @author_node end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/wordpress/author.rb', line 18 def ==(other) login == other.login end |
#email ⇒ Object
14 15 16 |
# File 'lib/wordpress/author.rb', line 14 def email .xpath("wp:author_email").text end |
#inspect ⇒ Object
22 23 24 |
# File 'lib/wordpress/author.rb', line 22 def inspect "WordPress::Author: #{login} <#{email}>" end |
#login ⇒ Object
10 11 12 |
# File 'lib/wordpress/author.rb', line 10 def login .xpath("wp:author_login").text end |
#to_refinery ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/wordpress/author.rb', line 26 def to_refinery user = User.find_or_initialize_by_username_and_email(login, email) unless user.persisted? user.password = 'password' user.password_confirmation = 'password' user.save end user end |