Navigation Menu

Skip to content

Commit

Permalink
Define shorthand to store/get role of myself
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2015
1 parent b6194b9 commit b020393
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/droonga/node_role.rb
Expand Up @@ -29,6 +29,19 @@ class << self
def valid?(role)
ROLES.include?(role)
end

def my_role
if @my_role
@my_role.to_s
else
SERVICE_PROVIDER
end
end

def my_role=(new_role)
@my_role = new(new_role)
@my_role.to_s
end
end

def initialize(role)
Expand Down

0 comments on commit b020393

Please sign in to comment.