Skip to content

Commit cddfec3

Browse files
committed
Working with the default set of model-level properties on various classes
1 parent 5402d6f commit cddfec3

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

lib/softlayer/BareMetalServer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BareMetalServer < Server
4040
#
4141
def bare_metal_instance?
4242
if has_sl_property?(:bareMetalInstanceFlag)
43-
self.bareMetalInstanceFlag != 0
43+
self["bareMetalInstanceFlag"] != 0
4444
else
4545
false
4646
end

lib/softlayer/Ticket.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@
2121
#
2222

2323
module SoftLayer
24-
class Ticket < SoftLayer::ModelBase
24+
class Ticket < SoftLayer::ModelBase
25+
26+
softlayer_attr :title
27+
softlayer_attr :subject
28+
29+
##
30+
# Returns true if the ticket has "unread" updates
31+
def has_updates?
32+
self["newUpdatesFlag"] != 0
33+
end
34+
35+
##
36+
# Returns true if the ticket is a server admin ticket
37+
def server_admin_ticket?
38+
self["serverAdministrationFlag"] != 0
39+
end
40+
2541
##
2642
# Add an update to this ticket.
2743
#

lib/softlayer/VirtualServer.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#
2222

2323
require 'time'
24-
require 'json'
2524

2625
module SoftLayer
2726
##
@@ -34,8 +33,6 @@ module SoftLayer
3433
class VirtualServer < Server
3534
include ::SoftLayer::ModelResource
3635

37-
softlayer_attr :createDate
38-
softlayer_attr :modifyDate
3936
softlayer_attr :provisionDate
4037
softlayer_attr :maxCpu
4138
softlayer_attr :activeTransaction

0 commit comments

Comments
 (0)