Class: Mackerel::Dashboard
- Inherits:
-
Object
- Object
- Mackerel::Dashboard
- Defined in:
- lib/mackerel/dashboard.rb
Instance Attribute Summary collapse
-
#bodyMarkdown ⇒ Object
Returns the value of attribute bodyMarkdown.
-
#createdAt ⇒ Object
Returns the value of attribute createdAt.
-
#id ⇒ Object
Returns the value of attribute id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updatedAt ⇒ Object
Returns the value of attribute updatedAt.
-
#urlPath ⇒ Object
Returns the value of attribute urlPath.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Dashboard
constructor
A new instance of Dashboard.
- #to_h ⇒ Object
- #to_json(options = nil) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Dashboard
Returns a new instance of Dashboard.
5 6 7 8 9 10 11 12 |
# File 'lib/mackerel/dashboard.rb', line 5 def initialize(args = {}) @id = args["id"] @title = args["title"] @bodyMarkdown = args["bodyMarkdown"] @urlPath = args["urlPath"] @createdAt = args["createdAt"] @updatedAt = args["updatedAt"] end |
Instance Attribute Details
#bodyMarkdown ⇒ Object
Returns the value of attribute bodyMarkdown.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def bodyMarkdown @bodyMarkdown end |
#createdAt ⇒ Object
Returns the value of attribute createdAt.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def createdAt @createdAt end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def id @id end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def title @title end |
#updatedAt ⇒ Object
Returns the value of attribute updatedAt.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def updatedAt @updatedAt end |
#urlPath ⇒ Object
Returns the value of attribute urlPath.
4 5 6 |
# File 'lib/mackerel/dashboard.rb', line 4 def urlPath @urlPath end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/mackerel/dashboard.rb', line 14 def to_h instance_variables.flat_map do |name| respond_to?(name[1..-1]) ? [name[1..-1]] : [] end.each_with_object({}) do |name, hash| hash[name] = public_send(name) end.delete_if { |key, val| val == nil } end |
#to_json(options = nil) ⇒ Object
22 23 24 |
# File 'lib/mackerel/dashboard.rb', line 22 def to_json( = nil) return to_h.to_json() end |