Navigation Menu

Skip to content

Commit

Permalink
Make methods not called from outside private
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 6, 2015
1 parent 1fd676c commit 3243ae2
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions lib/droonga/engine_node.rb
Expand Up @@ -69,34 +69,6 @@ def forward(message, destination)
end
end

def live?
@state.nil? or @state["live"]
end

def dead?
not live?
end

def service_provider?
role == NodeMetadata::Role::SERVICE_PROVIDER
end

def absorb_source?
role == NodeMetadata::Role::ABSORB_SOURCE
end

def absorb_destination?
role == NodeMetadata::Role::ABSORB_DESTINATION
end

def role
if @state
@state["role"]
else
NodeMetadata::Role::SERVICE_PROVIDER
end
end

def forwardable?
return false unless live?
role == @sender_role
Expand Down Expand Up @@ -142,6 +114,34 @@ def on_change
end

private
def role
if @state
@state["role"]
else
NodeMetadata::Role::SERVICE_PROVIDER
end
end

def live?
@state.nil? or @state["live"]
end

def dead?
not live?
end

def service_provider?
role == NodeMetadata::Role::SERVICE_PROVIDER
end

def absorb_source?
role == NodeMetadata::Role::ABSORB_SOURCE
end

def absorb_destination?
role == NodeMetadata::Role::ABSORB_DESTINATION
end

def output(message, destination)
command = destination["type"]
receiver = destination["to"]
Expand Down

0 comments on commit 3243ae2

Please sign in to comment.