Class: Status

Inherits:
Object show all
Defined in:
lib/jirametrics/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, id:, category_name:, category_id:) ⇒ Status

Returns a new instance of Status.



7
8
9
10
11
12
# File 'lib/jirametrics/status.rb', line 7

def initialize name:, id:, category_name:, category_id:
  @name = name
  @id = id
  @category_name = category_name
  @category_id = category_id
end

Instance Attribute Details

#category_idObject (readonly)

Returns the value of attribute category_id.



4
5
6
# File 'lib/jirametrics/status.rb', line 4

def category_id
  @category_id
end

#category_nameObject (readonly)

Returns the value of attribute category_name.



4
5
6
# File 'lib/jirametrics/status.rb', line 4

def category_name
  @category_name
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/jirametrics/status.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/jirametrics/status.rb', line 5

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/jirametrics/status.rb', line 4

def type
  @type
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/jirametrics/status.rb', line 19

def eql?(other)
  (other.class == self.class) && (other.state == state)
end

#stateObject



23
24
25
# File 'lib/jirametrics/status.rb', line 23

def state
  instance_variables.map { |variable| instance_variable_get variable }
end

#to_sObject



14
15
16
17
# File 'lib/jirametrics/status.rb', line 14

def to_s
  "Status(name=#{@name.inspect}, id=#{@id.inspect}," \
    " category_name=#{@category_name.inspect}, category_id=#{@category_id.inspect})"
end