Class: Yandex::Disk::Client::Request::Space::AttributesParser

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/yandex/disk/client/request/space.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#quota_available_bytesObject (readonly)

Returns the value of attribute quota_available_bytes.



31
32
33
# File 'lib/yandex/disk/client/request/space.rb', line 31

def quota_available_bytes
  @quota_available_bytes
end

#quota_used_bytesObject (readonly)

Returns the value of attribute quota_used_bytes.



31
32
33
# File 'lib/yandex/disk/client/request/space.rb', line 31

def quota_used_bytes
  @quota_used_bytes
end

Instance Method Details

#characters(string) ⇒ Object



42
43
44
45
# File 'lib/yandex/disk/client/request/space.rb', line 42

def characters string
  @quota_used_bytes = string.to_i if @is_quota_used_bytes
  @quota_available_bytes = string.to_i if @is_quota_available_bytes
end

#start_element(name, attributes = []) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/yandex/disk/client/request/space.rb', line 33

def start_element name, attributes = []
  case name
    when 'd:quota-used-bytes'
      @is_quota_used_bytes = true
    when 'd:quota-available-bytes'
      @is_quota_available_bytes = true
  end
end