Class: Ayadn::UserMetaObject

Inherits:
Object
  • Object
show all
Defined in:
lib/ayadn/user_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, username = nil) ⇒ UserMetaObject

Returns a new instance of UserMetaObject.



8
9
10
11
12
13
14
15
16
# File 'lib/ayadn/user_object.rb', line 8

def initialize hash, username = nil
  @input = hash["meta"].nil? ? {} : hash["meta"]
  @code = @input["code"]
  if code == 404
    Status.new.user_404(username)
    Errors.info("User #{username} doesn't exist")
    exit
  end
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/ayadn/user_object.rb', line 6

def code
  @code
end

#inputObject (readonly)

Returns the value of attribute input.



6
7
8
# File 'lib/ayadn/user_object.rb', line 6

def input
  @input
end