Class: Sink::Tag

Inherits:
Data
  • Object
show all
Defined in:
lib/sink/tag.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



4
5
6
# File 'lib/sink/tag.rb', line 4

def count
  @count
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/sink/tag.rb', line 4

def name
  @name
end

Class Method Details

.from_response(body) ⇒ Object



5
6
7
8
9
# File 'lib/sink/tag.rb', line 5

def self.from_response(body)
  return new(name: body.to_s, count: nil) unless body.is_a?(Hash)

  new(name: body["name"], count: body["count"])
end

Instance Method Details

#to_sObject



11
# File 'lib/sink/tag.rb', line 11

def to_s = name.to_s