Class: Epuber::OpfFile::ManifestItem

Inherits:
Object
  • Object
show all
Defined in:
lib/epuber/from_file/opf_file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, href, media_type, properties) ⇒ ManifestItem

Returns a new instance of ManifestItem.



22
23
24
25
26
27
# File 'lib/epuber/from_file/opf_file.rb', line 22

def initialize(id, href, media_type, properties)
  @id = id
  @href = href
  @media_type = media_type
  @properties = properties
end

Instance Attribute Details

#hrefString

Returns:

  • (String)


12
13
14
# File 'lib/epuber/from_file/opf_file.rb', line 12

def href
  @href
end

#idString

Returns:

  • (String)


8
9
10
# File 'lib/epuber/from_file/opf_file.rb', line 8

def id
  @id
end

#media_typeString

Returns:

  • (String)


16
17
18
# File 'lib/epuber/from_file/opf_file.rb', line 16

def media_type
  @media_type
end

#propertiesString?

Returns:

  • (String, nil)


20
21
22
# File 'lib/epuber/from_file/opf_file.rb', line 20

def properties
  @properties
end

Class Method Details

.from_node(node) ⇒ ManifestItem

Parameters:

Returns:



41
42
43
# File 'lib/epuber/from_file/opf_file.rb', line 41

def self.from_node(node)
  new(node['id'], node['href'], node['media-type'], node['properties'])
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


33
34
35
# File 'lib/epuber/from_file/opf_file.rb', line 33

def ==(other)
  @id == other.id
end