Skip to content

Commit

Permalink
Make version locked? work like you think it should
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwistow committed Jan 17, 2012
1 parent b05eb9f commit ebbfb3c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/fastly/version.rb
@@ -1,7 +1,7 @@
class Fastly
# An iteration of your configuration
class Version < Base
attr_accessor :service_id, :number, :name, :active, :locked, :staging, :testing, :deployed, :comment
attr_accessor :service_id, :number, :name, :active, :staging, :testing, :deployed, :comment

##
# :attr: service_id
Expand Down Expand Up @@ -52,6 +52,15 @@ class Version < Base
#
# a free form comment field

# Is this Version locked
def locked?
return @locked.to_i > 1
end

# Set whether this Version is locked
def locked=(is_locked)
@locked = is_locked ? "1" : "0"
end

# Get the Service object this Version belongs to
def service
Expand Down

0 comments on commit ebbfb3c

Please sign in to comment.