Class: Oos4ruby::Media

Inherits:
Bean::BeanClass show all
Includes:
Bean
Defined in:
lib/oos4ruby/media.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Bean

append_features

Methods inherited from Bean::BeanClass

#author, #contains?, #delete!, #to_s, #to_xml, #update!

Constructor Details

#initialize(entry, auth, slug = nil) ⇒ Media

Returns a new instance of Media.



10
11
12
13
14
# File 'lib/oos4ruby/media.rb', line 10

def initialize(entry, auth, slug = nil)
  @xml = entry
  @auth = auth
  @slug = slug || @xml.child('slug', OosNamespace).text      
end

Instance Attribute Details

#title=(value) ⇒ Object (writeonly)

Sets the attribute title

Parameters:

  • value

    the value to set the attribute title to.



8
9
10
# File 'lib/oos4ruby/media.rb', line 8

def title=(value)
  @title = value
end

Class Method Details

.dump!(opts, slug) ⇒ Object



16
17
18
19
# File 'lib/oos4ruby/media.rb', line 16

def Media.dump!(opts, slug)
  file = opts.delete(:file)
  file.respond_to?(:path) ? file : File.new(file)
end