Class: Fleakr::Api::LevelOption

Inherits:
SimpleOption show all
Defined in:
lib/fleakr/api/option.rb

Overview

LevelOption

Specify the “safety level” of this photo (e.g. safe / moderate / restricted)

Instance Attribute Summary

Attributes inherited from SimpleOption

#type

Instance Method Summary collapse

Methods inherited from SimpleOption

#initialize

Constructor Details

This class inherits a constructor from Fleakr::Api::SimpleOption

Instance Method Details

#to_hashObject

Hash representation of the safety_level for this photo



132
133
134
# File 'lib/fleakr/api/option.rb', line 132

def to_hash
  {:safety_level => value}
end

#valueObject

:nodoc:



122
123
124
125
126
127
128
# File 'lib/fleakr/api/option.rb', line 122

def value # :nodoc:
  case @value
    when :safe        then 1
    when :moderate    then 2
    when :restricted  then 3
  end
end