Class: HatenaFotolife::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/hatena_fotolife/image.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def id
  @id
end

#image_uriObject (readonly)

Returns the value of attribute image_uri.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def image_uri
  @image_uri
end

#image_uri_mediumObject (readonly)

Returns the value of attribute image_uri_medium.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def image_uri_medium
  @image_uri_medium
end

#image_uri_smallObject (readonly)

Returns the value of attribute image_uri_small.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def image_uri_small
  @image_uri_small
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def title
  @title
end

#uriObject (readonly)

Returns the value of attribute uri.



7
8
9
# File 'lib/hatena_fotolife/image.rb', line 7

def uri
  @uri
end

Class Method Details

.load_xml(xml) ⇒ HatenaFotolife::Image

Create a new image from a XML string.

Parameters:

  • xml (String)

    XML string representation

Returns:



12
13
14
# File 'lib/hatena_fotolife/image.rb', line 12

def self.load_xml(xml)
  HatenaFotolife::Image.new(xml)
end

Instance Method Details

#to_xmlString

Returns:

  • (String)


17
18
19
# File 'lib/hatena_fotolife/image.rb', line 17

def to_xml
  @document.to_s.gsub(/\"/, "'")
end