Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Aug 26, 2015
1 parent d539a6a commit 5e08fcd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/pio/open_flow10/actions.rb
Expand Up @@ -34,8 +34,8 @@ class Actions < BinData::Primitive

string :binary, read_length: :length

def set(value)
self.binary = [value].flatten.map(&:to_binary).join
def set(actions)
self.binary = Array(actions).map(&:to_binary).join
end

# rubocop:disable MethodLength
Expand Down
4 changes: 2 additions & 2 deletions lib/pio/open_flow13/actions.rb
Expand Up @@ -17,8 +17,8 @@ class Actions < BinData::Primitive

string :binary, read_length: :length

def set(value)
self.binary = [value].flatten.map(&:to_binary).join
def set(actions)
self.binary = Array(actions).map(&:to_binary).join
end

# rubocop:disable MethodLength
Expand Down
4 changes: 2 additions & 2 deletions lib/pio/open_flow13/flow_mod.rb
Expand Up @@ -69,8 +69,8 @@ class Instructions < BinData::Primitive
count_bytes_remaining :instructions_length
string :instructions, read_length: :instructions_length

def set(object)
self.instructions = [object].flatten.map(&:to_binary_s).join
def set(instructions)
self.instructions = Array(instructions).map(&:to_binary_s).join
end

# rubocop:disable MethodLength
Expand Down

0 comments on commit 5e08fcd

Please sign in to comment.