Class: Wordpressto::WordpressAttachment
Instance Attribute Summary collapse
-
#file ⇒ Object
writeonly
Sets the attribute file.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#mimetype ⇒ Object
Returns the value of attribute mimetype.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(attributes, options = { }) ⇒ WordpressAttachment
constructor
A new instance of WordpressAttachment.
- #save ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(attributes, options = { }) ⇒ WordpressAttachment
Returns a new instance of WordpressAttachment.
80 81 82 83 84 85 86 |
# File 'lib/wordpressto.rb', line 80 def initialize(attributes, = { }) super() self.name = attributes[:name] self.filename = attributes[:filename] self.mimetype = attributes[:mimetype] self.file = attributes[:file] end |
Instance Attribute Details
#file=(value) ⇒ Object
Sets the attribute file
78 79 80 |
# File 'lib/wordpressto.rb', line 78 def file=(value) @file = value end |
#filename ⇒ Object
Returns the value of attribute filename.
78 79 80 |
# File 'lib/wordpressto.rb', line 78 def filename @filename end |
#mimetype ⇒ Object
Returns the value of attribute mimetype.
78 79 80 |
# File 'lib/wordpressto.rb', line 78 def mimetype @mimetype end |
#name ⇒ Object
Returns the value of attribute name.
78 79 80 |
# File 'lib/wordpressto.rb', line 78 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
78 79 80 |
# File 'lib/wordpressto.rb', line 78 def url @url end |
Instance Method Details
#save ⇒ Object
88 89 90 91 92 |
# File 'lib/wordpressto.rb', line 88 def save ret = conn.upload_file(name, mimetype, bits) self.url = ret["url"] self end |